You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am wondering if there is an existing way to do this, or if this might be a good idea: I'm building a form around a schema that I don't own. Some of the fields in this existing schema are defined as open text fields, but I want to restrict the incoming values and present a multiple-choice "select" box. Can I do this entirely in the UI configuration? I realize it's a bit of an anti-pattern to hide validation rules in the UI, but there are benefits to my use-case in not forking the schema itself.
Expected behavior
I can define a ui:widget as "select" or "checkboxes" for a simple string fields, and define the available options in the ui configuration.
Actual behavior
A field must have enum values in the schema itself for a select box to be available as a form widget.
Version
Whatever the live playground is currently running? (1.8.1?)
The text was updated successfully, but these errors were encountered:
You could define a custom widget that does this, which reads values from uiSchema["ui:options"]["enum"] and renders a dropdown. Maybe we could also add it to react-jsonschema-form.
We do support an autocomplete option with the examples keyword, if that's useful at all: #1517
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please leave a comment if this is still an issue for you. Thank you.
Prerequisites
Description
I am wondering if there is an existing way to do this, or if this might be a good idea: I'm building a form around a schema that I don't own. Some of the fields in this existing schema are defined as open text fields, but I want to restrict the incoming values and present a multiple-choice "select" box. Can I do this entirely in the UI configuration? I realize it's a bit of an anti-pattern to hide validation rules in the UI, but there are benefits to my use-case in not forking the schema itself.
Expected behavior
I can define a ui:widget as "select" or "checkboxes" for a simple string fields, and define the available options in the ui configuration.
Actual behavior
A field must have
enum
values in the schema itself for a select box to be available as a form widget.Version
Whatever the live playground is currently running? (1.8.1?)
The text was updated successfully, but these errors were encountered: