From a6edd4359ece084b68a6d6105a66b55614da8dc2 Mon Sep 17 00:00:00 2001 From: Alexander Mikhaylov Date: Tue, 21 Oct 2025 17:16:40 +0100 Subject: [PATCH] fix(ui-multi-selector): improve filled state * allow to search more values for selector with autocomplete while limit doesn't reach --- .changeset/ten-goats-talk.md | 6 ++++++ .../src/UiMultiSelector/UiMultiSelector.tsx | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 .changeset/ten-goats-talk.md 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);