-
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
fix: Cast the value as an Array in CheckboxesWidget #3379
Merged
heath-freenome
merged 2 commits into
rjsf-team:main
from
heath-freenome:reimplement-2142-fixing-2141
Jan 16, 2023
Merged
fix: Cast the value as an Array in CheckboxesWidget #3379
heath-freenome
merged 2 commits into
rjsf-team:main
from
heath-freenome:reimplement-2142-fixing-2141
Jan 16, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
heath-freenome
force-pushed
the
reimplement-2142-fixing-2141
branch
from
January 15, 2023 03:59
22b4464
to
bdc59a9
Compare
nickgros
requested changes
Jan 15, 2023
Fixes rjsf-team#2141 by reimplementing rjsf-team#2142 When the value passed to the `CheckboxesWidget` was a single value rather than an array, things would break in the control - Updated the `CheckboxesWidget` in all themes but `antd` (which uses simpler logic) to fix ensure the value used in the helper functions is an array - Added a test in `ArrayField_test.ts` that verifies the fix - Updated the snapshot in `bootstrap-4` which showed an issue when the value string contained an element of the enumeration value rather than the whole value - Refactored the common `selectValue` and `deselectValue` functions used in `CheckboxesWidget` into `@rjsf/utils` - Updated the `CHANGELOG.md` accordingly
…onsDeselectValue()` and `enumOptionsSelectValue()` from all the `CheckboxesWidget` implementations into `@rjsf/utils`
heath-freenome
force-pushed
the
reimplement-2142-fixing-2141
branch
from
January 16, 2023 00:03
bdc59a9
to
ce84edf
Compare
nickgros
approved these changes
Jan 16, 2023
shijistar
pushed a commit
to shijistar/react-jsonschema-form
that referenced
this pull request
Jun 8, 2023
* fix: Cast the value as an Array in CheckboxesWidget Fixes rjsf-team#2141 by reimplementing rjsf-team#2142 When the value passed to the `CheckboxesWidget` was a single value rather than an array, things would break in the control - Updated the `CheckboxesWidget` in all themes but `antd` (which uses simpler logic) to fix ensure the value used in the helper functions is an array - Added a test in `ArrayField_test.ts` that verifies the fix - Updated the snapshot in `bootstrap-4` which showed an issue when the value string contained an element of the enumeration value rather than the whole value - Refactored the common `selectValue` and `deselectValue` functions used in `CheckboxesWidget` into `@rjsf/utils` - Updated the `CHANGELOG.md` accordingly * - Responded to reviewer feedback, including refactoring the `enumOptionsDeselectValue()` and `enumOptionsSelectValue()` from all the `CheckboxesWidget` implementations into `@rjsf/utils`
shijistar
pushed a commit
to shijistar/react-jsonschema-form
that referenced
this pull request
Jun 8, 2023
* fix: Cast the value as an Array in CheckboxesWidget Fixes rjsf-team#2141 by reimplementing rjsf-team#2142 When the value passed to the `CheckboxesWidget` was a single value rather than an array, things would break in the control - Updated the `CheckboxesWidget` in all themes but `antd` (which uses simpler logic) to fix ensure the value used in the helper functions is an array - Added a test in `ArrayField_test.ts` that verifies the fix - Updated the snapshot in `bootstrap-4` which showed an issue when the value string contained an element of the enumeration value rather than the whole value - Refactored the common `selectValue` and `deselectValue` functions used in `CheckboxesWidget` into `@rjsf/utils` - Updated the `CHANGELOG.md` accordingly * - Responded to reviewer feedback, including refactoring the `enumOptionsDeselectValue()` and `enumOptionsSelectValue()` from all the `CheckboxesWidget` implementations into `@rjsf/utils`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Reasons for making this change
Fixes #2141 by reimplementing #2142 for all themes but
antd
When the value passed to the
CheckboxesWidget
was a single value rather than an array, things would break in the controlCheckboxesWidget
in all themes butantd
(which uses simpler logic) to fix ensure the value used in the helper functions is an arrayArrayField_test.ts
that verifies the fixbootstrap-4
which showed an issue when the value string contained an element of the enumeration value rather than the whole valueselectValue
anddeselectValue
functions used inCheckboxesWidget
into@rjsf/utils
and used them in theCheckboxesWidget
CHANGELOG.md
accordinglyChecklist
npm run test:update
to update snapshots, if needed.