Skip to content

Commit

Permalink
fix : default value for radio button group rjsf-team#3511
Browse files Browse the repository at this point in the history
  • Loading branch information
sravimohan committed Mar 21, 2023
1 parent 8e203c2 commit 366a5f0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/chakra-ui/src/RadioWidget/RadioWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default function RadioWidget<T = any, S extends StrictRJSFSchema = RJSFSc
onFocus(id, enumOptionsValueForIndex<S>(value, enumOptions, emptyValue));

const row = options ? options.inline : false;
const selectedIndex = enumOptionsIndexForValue<S>(value, enumOptions) as string;
const selectedIndex = (enumOptionsIndexForValue<S>(value, enumOptions) as string) ?? null;

return (
<FormControl mb={1} {...chakraProps} isDisabled={disabled || readonly} isRequired={required} isReadOnly={readonly}>
Expand Down
2 changes: 1 addition & 1 deletion packages/material-ui/src/RadioWidget/RadioWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default function RadioWidget<T = any, S extends StrictRJSFSchema = RJSFSc
onFocus(id, enumOptionsValueForIndex<S>(value, enumOptions, emptyValue));

const row = options ? options.inline : false;
const selectedIndex = enumOptionsIndexForValue<S>(value, enumOptions);
const selectedIndex = enumOptionsIndexForValue<S>(value, enumOptions) ?? null;

return (
<>
Expand Down
2 changes: 1 addition & 1 deletion packages/mui/src/RadioWidget/RadioWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default function RadioWidget<T = any, S extends StrictRJSFSchema = RJSFSc
onFocus(id, enumOptionsValueForIndex<S>(value, enumOptions, emptyValue));

const row = options ? options.inline : false;
const selectedIndex = enumOptionsIndexForValue<S>(value, enumOptions);
const selectedIndex = enumOptionsIndexForValue<S>(value, enumOptions) ?? null;

return (
<>
Expand Down

0 comments on commit 366a5f0

Please sign in to comment.