Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I eliminate the select dropdown when using anyOf? #4469

Open
1 task done
zeckdude opened this issue Jan 28, 2025 · 0 comments
Open
1 task done

How do I eliminate the select dropdown when using anyOf? #4469

zeckdude opened this issue Jan 28, 2025 · 0 comments
Labels
needs triage Initial label given, to be assigned correct labels and assigned question

Comments

@zeckdude
Copy link

Prerequisites

What theme are you using?

core

What is your question?

I have this example schema in the playground:

{
  "title": "A registration form",
  "description": "A simple form example.",
  "type": "object",
  "required": [
    "firstName",
    "lastName"
  ],
  "properties": {
    "ipAddresses": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "string",
            "format": "ipv4"
          },
          {
            "type": "string",
            "format": "ipv6"
          }
        ]
      }
    }
  }
}

I'm trying to collect multiple IP addresses but when it shows the UI elements, it shows the text field (which I want) but it also shows a dropdown with Option 1 and Option 2 as the options (which I don't want). How can I remove that dropdown?

As a bonus, how can I implement validation based on the fact that this field should be an IP address?

As a second bonus, how can I set the section titles and field titles so it sounds more natural? Do I need to set that in the UI schema or in the JSON schema?

Image

@zeckdude zeckdude added needs triage Initial label given, to be assigned correct labels and assigned question labels Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Initial label given, to be assigned correct labels and assigned question
Projects
None yet
Development

No branches or pull requests

1 participant