Skip to content

Commit

Permalink
fix isMultiple check by adding compare with false
Browse files Browse the repository at this point in the history
  • Loading branch information
antpaw committed Aug 24, 2023
1 parent 0456cde commit f9e1088
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ it according to semantic versioning. For example, if your PR adds a breaking cha
should change the heading of the (upcoming) version to include a major version bump.
-->
# 5.12.2

- Fixed a faulty check of the `isMultiple` option in `MultiSchemaField` fixing the select element. It no longer offers multiple choice in a `oneOf` case in Chakra UI

# 5.12.1

## @rjsf/validator-ajv8
Expand Down
2 changes: 1 addition & 1 deletion packages/chakra-ui/src/SelectWidget/SelectWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default function SelectWidget<T = any, S extends StrictRJSFSchema = RJSFS
})
: [];

const isMultiple = typeof multiple !== 'undefined' && Boolean(enumOptions);
const isMultiple = typeof multiple !== 'undefined' && multiple !== false && Boolean(enumOptions);
const selectedIndex = enumOptionsIndexForValue<S>(value, enumOptions, isMultiple);
const formValue: any = isMultiple
? ((selectedIndex as string[]) || []).map((i: string) => {
Expand Down

0 comments on commit f9e1088

Please sign in to comment.