diff --git a/.changeset/ten-goats-talk.md b/.changeset/ten-goats-talk.md new file mode 100644 index 00000000..97d935fc --- /dev/null +++ b/.changeset/ten-goats-talk.md @@ -0,0 +1,6 @@ +--- +"@tabula/ui-multi-selector": patch +--- + +Fix filled state for selector with autocomplete + \ No newline at end of file diff --git a/components/ui-multi-selector/src/UiMultiSelector/UiMultiSelector.tsx b/components/ui-multi-selector/src/UiMultiSelector/UiMultiSelector.tsx index 42cdef50..455c5faa 100644 --- a/components/ui-multi-selector/src/UiMultiSelector/UiMultiSelector.tsx +++ b/components/ui-multi-selector/src/UiMultiSelector/UiMultiSelector.tsx @@ -102,9 +102,11 @@ export function UiMultiSelector({ }); const isEmpty = selected.size === 0; + + const definedValueOnly = !allowsCustomValue && onAutocomplete == null; const isFilled = (maxSelectedLimit != null && selected.size >= maxSelectedLimit) || - (!allowsCustomValue && options.length > 0 && selected.size === options.length); + (definedValueOnly && options.length > 0 && selected.size === options.length); const isPopupVisible = !isDisabled && !isFilled; const isSearchVisible = isPopupVisible || (isDisabled && isEmpty);