-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Allow object selection in dropdowns #1494
Comments
Hi @tdamsma , how about if you use |
@KKS1 that would work as a work around to hide the fields, thanks! Still makes using this option slightly cumbersome, as the jsonschema's I use are dynamically generated so this would require generating an accompanying uiSchema. Would be nice if the uiSchema could be merged with the jsonschema, but that is a another discussion |
Yeah, merging this into #701 then. |
Fixes rjsf-team#1494, reimplementing rjsf-team#1562 to make all widgets that render `enumOptions` switch from option value to option index - In `@rjsf/utils`, added/updated `enumOptionsXXXX` methods that enable using index instead of values - Added 100% unit tests for these new methods - Also remove the now unnecessary `processSelectValue()` function and its unit test - In all themes, updated the `CheckboxesWidget`, `RadioWidget` and `SelectWidget` to use the `enumOptions[]` index rather than value for the html elements - Utilized the new `enumOptionsXXXX` methods to facilitate this transformation - Updated the documentation for the new methods and the breaking change this causes - Updated the `CHANGELOG.md` file accordingly
Fixes rjsf-team#1494, reimplementing rjsf-team#1562 to make all widgets that render `enumOptions` switch from option value to option index - In `@rjsf/utils`, added/updated `enumOptionsXXXX` methods that enable using index instead of values - Added 100% unit tests for these new methods - Also remove the now unnecessary `processSelectValue()` function and its unit test - In all themes, updated the `CheckboxesWidget`, `RadioWidget` and `SelectWidget` to use the `enumOptions[]` index rather than value for the html elements - Utilized the new `enumOptionsXXXX` methods to facilitate this transformation - Updated the tests in `core` and snapshots in the other themes to represent this change from value to index - Updated the documentation for the new methods and the breaking change this causes - Updated the `CHANGELOG.md` file accordingly
Fixes rjsf-team#1494, reimplementing rjsf-team#1562 to make all widgets that render `enumOptions` switch from option value to option index - In `@rjsf/utils`, added/updated `enumOptionsXXXX` methods that enable using index instead of values - Added 100% unit tests for these new methods - Also remove the now unnecessary `processSelectValue()` function and its unit test - In all themes, updated the `CheckboxesWidget`, `RadioWidget` and `SelectWidget` to use the `enumOptions[]` index rather than value for the html elements - Utilized the new `enumOptionsXXXX` methods to facilitate this transformation - Updated the tests in `core` and snapshots in the other themes to represent this change from value to index - Updated the documentation for the new methods and the breaking change this causes - Updated the `CHANGELOG.md` file accordingly
Fixes rjsf-team#1494, reimplementing rjsf-team#1562 to make all widgets that render `enumOptions` switch from option value to option index - In `@rjsf/utils`, added/updated `enumOptionsXXXX` methods that enable using index instead of values - Added 100% unit tests for these new methods - Also remove the now unnecessary `processSelectValue()` function and its unit test - In all themes, updated the `CheckboxesWidget`, `RadioWidget` and `SelectWidget` to use the `enumOptions[]` index rather than value for the html elements - Utilized the new `enumOptionsXXXX` methods to facilitate this transformation - Updated the tests in `core` and snapshots in the other themes to represent this change from value to index - Updated the documentation for the new methods and the breaking change this causes - Updated the `CHANGELOG.md` file accordingly
Fixes rjsf-team#1494, reimplementing rjsf-team#1562 to make all widgets that render `enumOptions` switch from option value to option index - In `@rjsf/utils`, added/updated `enumOptionsXXXX` methods that enable using index instead of values - Added 100% unit tests for these new methods - Also remove the now unnecessary `processSelectValue()` function and its unit test - In all themes, updated the `CheckboxesWidget`, `RadioWidget` and `SelectWidget` to use the `enumOptions[]` index rather than value for the html elements - Utilized the new `enumOptionsXXXX` methods to facilitate this transformation - Updated the tests in `core` and snapshots in the other themes to represent this change from value to index - Updated the documentation for the new methods and the breaking change this causes - Updated the `CHANGELOG.md` file accordingly
Fixes rjsf-team#1494, reimplementing rjsf-team#1562 to make all widgets that render `enumOptions` switch from option value to option index - In `@rjsf/utils`, added/updated `enumOptionsXXXX` methods that enable using index instead of values - Added 100% unit tests for these new methods - Also remove the now unnecessary `processSelectValue()` function and its unit test - In all themes, updated the `CheckboxesWidget`, `RadioWidget` and `SelectWidget` to use the `enumOptions[]` index rather than value for the html elements - Utilized the new `enumOptionsXXXX` methods to facilitate this transformation - Updated the tests in `core` and snapshots in the other themes to represent this change from value to index - Updated the documentation for the new methods and the breaking change this causes - Updated the `CHANGELOG.md` file accordingly
Fixes rjsf-team#1494, reimplementing rjsf-team#1562 to make all widgets that render `enumOptions` switch from option value to option index - In `@rjsf/utils`, added/updated `enumOptionsXXXX` methods that enable using index instead of values - Added 100% unit tests for these new methods - Also remove the now unnecessary `processSelectValue()` function and its unit test - In all themes, updated the `CheckboxesWidget`, `RadioWidget` and `SelectWidget` to use the `enumOptions[]` index rather than value for the html elements - Utilized the new `enumOptionsXXXX` methods to facilitate this transformation - Updated the tests in `core` and snapshots in the other themes to represent this change from value to index - Updated the `playground` to add the new `Enumerated Object` example - Updated the documentation for the new methods and the breaking change this causes - Updated the `CHANGELOG.md` file accordingly
Fixes rjsf-team#1494, reimplementing rjsf-team#1562 to make all widgets that render `enumOptions` switch from option value to option index - In `@rjsf/utils`, added/updated `enumOptionsXXXX` methods that enable using index instead of values - Added 100% unit tests for these new methods - Updated `optionId()` to take an index rather than an option - Also remove the now unnecessary `processSelectValue()` function and its unit test - In all themes, updated the `CheckboxesWidget`, `RadioWidget` and `SelectWidget` to use the `enumOptions[]` index rather than value for the html elements - Utilized the new `enumOptionsXXXX` methods to facilitate this transformation - Also passed index to `optionId()` rather than option - Updated the tests in `core` and snapshots in the other themes to represent this change from value to index - Updated the `playground` to add the new `Enumerated Object` example - Updated the documentation for the new methods and the breaking change this causes - Updated the `CHANGELOG.md` file accordingly
Fixes rjsf-team#1494, reimplementing rjsf-team#1562 to make all widgets that render `enumOptions` switch from option value to option index - In `@rjsf/utils`, added/updated `enumOptionsXXXX` methods that enable using index instead of values - Added 100% unit tests for these new methods - Updated `optionId()` to take an index rather than an option - Also remove the now unnecessary `processSelectValue()` function and its unit test - In all themes, updated the `CheckboxesWidget`, `RadioWidget` and `SelectWidget` to use the `enumOptions[]` index rather than value for the html elements - Utilized the new `enumOptionsXXXX` methods to facilitate this transformation - Also passed index to `optionId()` rather than option - Updated the tests in `core` and snapshots in the other themes to represent this change from value to index - Updated the `playground` to add the new `Enumerated Object` example - Updated the documentation for the new methods and the breaking change this causes - Updated the `CHANGELOG.md` file accordingly
Fixes rjsf-team#1494, reimplementing rjsf-team#1562 to make all widgets that render `enumOptions` switch from option value to option index - In `@rjsf/utils`, added/updated `enumOptionsXXXX` methods that enable using index instead of values - Added 100% unit tests for these new methods - Updated `optionId()` to take an index rather than an option - Also remove the now unnecessary `processSelectValue()` function and its unit test - In all themes, updated the `CheckboxesWidget`, `RadioWidget` and `SelectWidget` to use the `enumOptions[]` index rather than value for the html elements - Utilized the new `enumOptionsXXXX` methods to facilitate this transformation - Also passed index to `optionId()` rather than option - Updated the tests in `core` and snapshots in the other themes to represent this change from value to index - Updated the `playground` to add the new `Enumerated Object` example - Updated the documentation for the new methods and the breaking change this causes - Updated the `CHANGELOG.md` file accordingly
Fixes rjsf-team#1494, reimplementing rjsf-team#1562 to make all widgets that render `enumOptions` switch from option value to option index - In `@rjsf/utils`, added/updated `enumOptionsXXXX` methods that enable using index instead of values - Added 100% unit tests for these new methods - Updated `optionId()` to take an index rather than an option - Also remove the now unnecessary `processSelectValue()` function and its unit test - In all themes, updated the `CheckboxesWidget`, `RadioWidget` and `SelectWidget` to use the `enumOptions[]` index rather than value for the html elements - Utilized the new `enumOptionsXXXX` methods to facilitate this transformation - Also passed index to `optionId()` rather than option - Updated the tests in `core` and snapshots in the other themes to represent this change from value to index - Updated the `playground` to add the new `Enumerated Object` example - Updated the documentation for the new methods and the breaking change this causes - Updated the `CHANGELOG.md` file accordingly
* Fix: switch enumOptions rendering widgets to use indexes Fixes #1494, reimplementing #1562 to make all widgets that render `enumOptions` switch from option value to option index - In `@rjsf/utils`, added/updated `enumOptionsXXXX` methods that enable using index instead of values - Added 100% unit tests for these new methods - Updated `optionId()` to take an index rather than an option - Also remove the now unnecessary `processSelectValue()` function and its unit test - In all themes, updated the `CheckboxesWidget`, `RadioWidget` and `SelectWidget` to use the `enumOptions[]` index rather than value for the html elements - Utilized the new `enumOptionsXXXX` methods to facilitate this transformation - Also passed index to `optionId()` rather than option - Updated the tests in `core` and snapshots in the other themes to represent this change from value to index - Updated the `playground` to add the new `Enumerated Object` example - Updated the documentation for the new methods and the breaking change this causes - Updated the `CHANGELOG.md` file accordingly * Apply suggestions from code review Co-authored-by: Nick Grosenbacher <[email protected]> --------- Co-authored-by: Nick Grosenbacher <[email protected]>
I want to present a dropdown with options that when selected populate the formData with an object.
Consider this schema:
I would like a dropdown that gives the options
Work
andHome
but that doesn't store a string but the entire object with name, lat, lon. The schema above does not render properly at all.The closest I could get to the intended behavior is the following:
This renders all the fields disabled. What I would want is to nut render the name/lat/lon fields at all (only the title dropdown), but do pass them to the formData.
The text was updated successfully, but these errors were encountered: