-
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
Cast the value as an Array in CheckboxesWidget #2142
Cast the value as an Array in CheckboxesWidget #2142
Conversation
fe22c66
to
955ee32
Compare
I think that the deployment failure on Netlify is unrelated:
https://app.netlify.com/sites/rjsf/deploys/5fbec83bb2cc8c0008100b2a |
@Mogztter It's been a long time since you put up this PR... Sorry it was never reviewed, until now... AND because the v5 beta converted the component to Typescript, you will have to update your PR to get the fix in. Also, can you please make sure there is a test written to verify the fix. Thanks |
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 - Updated the `CHANGELOG.md` accordingly
Reimplemented for all themes in #3379 |
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 - Updated the `CHANGELOG.md` accordingly
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
* fix: Cast the value as an Array in CheckboxesWidget Fixes #2141 by reimplementing #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`
* 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`
* 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`
Reasons for making this change
Fixes #2141