Skip to content

Commit

Permalink
fix(material-ui): fix RangeWidget onChange handler rjsf-team#2161 (rj…
Browse files Browse the repository at this point in the history
…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 <51679588+heath-freenome@users.noreply.github.com>
  • Loading branch information
2 people authored and shijistar committed Jun 8, 2023
1 parent 7a2f5dc commit b9a7aa8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
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);
};
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

0 comments on commit b9a7aa8

Please sign in to comment.