Skip to content
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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/material-ui/src/RangeWidget/RangeWidget.tsx
Expand Up @@ -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);
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, done.

};
const _onBlur = ({ target: { value } }: React.FocusEvent<HTMLInputElement>) =>
onBlur(id, value);
Expand Down
2 changes: 1 addition & 1 deletion packages/mui/src/RangeWidget/RangeWidget.tsx
Expand Up @@ -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);
};
const _onBlur = ({ target: { value } }: React.FocusEvent<HTMLInputElement>) =>
onBlur(id, value);
Expand Down