-
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(material-ui): fix RangeWidget onChange handler #2161 #3297
fix(material-ui): fix RangeWidget onChange handler #2161 #3297
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RangeWidget's onChange handler for material-ui package was broken due to conditional being the wrong way around. This caused new non empty values to be changed to options.emptyValue
on change.
@@ -19,7 +19,7 @@ const RangeWidget = ({ | |||
const sliderProps = { value, label, id, name: id, ...rangeSpec(schema) }; | |||
|
|||
const _onChange = (_: any, value?: number | number[]) => { | |||
onChange(value ? options.emptyValue : value); | |||
onChange(value ? value : options.emptyValue); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It it likely that the same code is in packages/mui/src/RangeWidget/RangeWidget.tsx
. Please update that as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, done.
@JonCatmull Oh shoot, I forgot to ask you to upgrade the |
NVM, I'm making a fix and will add them myself so that we can get this merged quicker |
…/utils fix: rjsf-team#3239 by providing a new `ErrorSchemaBuilder` class in `@rjsf/utils` - In `@rjsf/utils` added `ErrorSchemaBuilder` to facilitate building `ErrorSchema` objects without the need for fancy casting - Exported the new class as part of the main `index.js` - Added 100% unit tests - In `@rjsf/validator-ajv6` and `@rjsf/validator-ajv8` updated the `toErrorSchema()` function to use the `ErrorSchemaBuilder` to simplify the implementation - Also updated the tests to use the `ErrorSchemaBuilder` to replace the expected values that required doing `as ErrorSchema` casting - Updated the `utility-functions.md` file to document `ErrorSchemaBuilder` - Updated the `CHANGELOG.md` accordingly for this fix as well as PR rjsf-team#3297
…/utils fix: rjsf-team#3239 by providing a new `ErrorSchemaBuilder` class in `@rjsf/utils` - In `@rjsf/utils` added `ErrorSchemaBuilder` to facilitate building `ErrorSchema` objects without the need for fancy casting - Exported the new class as part of the main `index.js` - Added 100% unit tests - In `@rjsf/validator-ajv6` and `@rjsf/validator-ajv8` updated the `toErrorSchema()` function to use the `ErrorSchemaBuilder` to simplify the implementation - Also updated the tests to use the `ErrorSchemaBuilder` to replace the expected values that required doing `as ErrorSchema` casting - Updated the `utility-functions.md` file to document `ErrorSchemaBuilder` - Updated the `CHANGELOG.md` accordingly for this fix as well as PR rjsf-team#3297
…3307) fix: #3239 by providing a new `ErrorSchemaBuilder` class in `@rjsf/utils` - In `@rjsf/utils` added `ErrorSchemaBuilder` to facilitate building `ErrorSchema` objects without the need for fancy casting - Exported the new class as part of the main `index.js` - Added 100% unit tests - In `@rjsf/validator-ajv6` and `@rjsf/validator-ajv8` updated the `toErrorSchema()` function to use the `ErrorSchemaBuilder` to simplify the implementation - Also updated the tests to use the `ErrorSchemaBuilder` to replace the expected values that required doing `as ErrorSchema` casting - Updated the `utility-functions.md` file to document `ErrorSchemaBuilder` - Updated the `CHANGELOG.md` accordingly for this fix as well as PR #3297
…sf-team#3297) * fix(material-ui): fix RangeWidget onChange handler rjsf-team#2161 * fix(mui): fix RangeWidget onChange handler rjsf-team#2161 Co-authored-by: Heath C <[email protected]>
…/utils (rjsf-team#3307) fix: rjsf-team#3239 by providing a new `ErrorSchemaBuilder` class in `@rjsf/utils` - In `@rjsf/utils` added `ErrorSchemaBuilder` to facilitate building `ErrorSchema` objects without the need for fancy casting - Exported the new class as part of the main `index.js` - Added 100% unit tests - In `@rjsf/validator-ajv6` and `@rjsf/validator-ajv8` updated the `toErrorSchema()` function to use the `ErrorSchemaBuilder` to simplify the implementation - Also updated the tests to use the `ErrorSchemaBuilder` to replace the expected values that required doing `as ErrorSchema` casting - Updated the `utility-functions.md` file to document `ErrorSchemaBuilder` - Updated the `CHANGELOG.md` accordingly for this fix as well as PR rjsf-team#3297
…sf-team#3297) * fix(material-ui): fix RangeWidget onChange handler rjsf-team#2161 * fix(mui): fix RangeWidget onChange handler rjsf-team#2161 Co-authored-by: Heath C <[email protected]>
…/utils (rjsf-team#3307) fix: rjsf-team#3239 by providing a new `ErrorSchemaBuilder` class in `@rjsf/utils` - In `@rjsf/utils` added `ErrorSchemaBuilder` to facilitate building `ErrorSchema` objects without the need for fancy casting - Exported the new class as part of the main `index.js` - Added 100% unit tests - In `@rjsf/validator-ajv6` and `@rjsf/validator-ajv8` updated the `toErrorSchema()` function to use the `ErrorSchemaBuilder` to simplify the implementation - Also updated the tests to use the `ErrorSchemaBuilder` to replace the expected values that required doing `as ErrorSchema` casting - Updated the `utility-functions.md` file to document `ErrorSchemaBuilder` - Updated the `CHANGELOG.md` accordingly for this fix as well as PR rjsf-team#3297
fix: #2161
RangeWidget's onChange handler for material-ui package was broken due to conditional being the wrong way around. This caused new non empty values to be changed to options.emptyValue on change.