diff --git a/src/components/inputs/Autocomplete/Autocomplete.tsx b/src/components/inputs/Autocomplete/Autocomplete.tsx index f8bcfb23..b178dc03 100644 --- a/src/components/inputs/Autocomplete/Autocomplete.tsx +++ b/src/components/inputs/Autocomplete/Autocomplete.tsx @@ -325,6 +325,10 @@ const Autocomplete: React.FC> = ({ [ListboxProps, handleLoadOptions, hasMore, isPaginated, localInput] ) + const localValue = useMemo(() => { + return simpleValue ? getSimpleValue(loadOptions ? asyncOptions : options, value, valueKey, isMultiSelection) : value + }, [simpleValue, loadOptions, asyncOptions, options, value, valueKey, isMultiSelection]) + return ( {noOptionsText}} @@ -348,7 +352,7 @@ const Autocomplete: React.FC> = ({ getOptionLabel={handleOptionLabel} isOptionEqualToValue={isOptionEqualToValue} getOptionDisabled={getOptionDisabled} - value={simpleValue ? getSimpleValue(loadOptions ? asyncOptions : options, value, valueKey, isMultiSelection) : value} + value={localValue} multiple={isMultiSelection} onChange={handleChange} onInputChange={handleInputChange}