Skip to content

Commit

Permalink
Merge pull request #8602 from marmelab/make-autocompleteinput-resilient
Browse files Browse the repository at this point in the history
Fix AutocompleteInput when multiple is true and value is not an array
  • Loading branch information
fzaninotto committed Jan 27, 2023
2 parents e3ee94c + b6567aa commit 1dc4e6b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/input/AutocompleteInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ const getSelectedItems = (
multiple
) => {
if (multiple) {
return (value || [])
return (Array.isArray(value || []) ? value : [value])
.map(item =>
choices.find(
choice => String(item) === String(get(choice, optionValue))
Expand Down

0 comments on commit 1dc4e6b

Please sign in to comment.