From b6567aaaed5e99f3fe96621a9fcafa6df7856453 Mon Sep 17 00:00:00 2001 From: Gildas Garcia <1122076+djhi@users.noreply.github.com> Date: Fri, 27 Jan 2023 17:24:36 +0100 Subject: [PATCH] Fix AutocompleteInput when multiple is true and value is not an array --- packages/ra-ui-materialui/src/input/AutocompleteInput.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ra-ui-materialui/src/input/AutocompleteInput.tsx b/packages/ra-ui-materialui/src/input/AutocompleteInput.tsx index c50a8a0032e..da1ae1c68c9 100644 --- a/packages/ra-ui-materialui/src/input/AutocompleteInput.tsx +++ b/packages/ra-ui-materialui/src/input/AutocompleteInput.tsx @@ -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))