Skip to content

Commit

Permalink
[@mantine/core] Fix MultiSelect nothingFoundMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaden Gregory committed Oct 9, 2023
1 parent 9aef3f5 commit e9eaf9b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/mantine-core/src/components/MultiSelect/MultiSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,8 @@ export const MultiSelect = factory<MultiSelectFactory>((_props, ref) => {
/>
);

const filteredData = filterPickedValues({ data: parsedData, value: _value });

return (
<>
<Combobox
Expand Down Expand Up @@ -354,16 +356,16 @@ export const MultiSelect = factory<MultiSelectFactory>((_props, ref) => {

<OptionsDropdown
data={
hidePickedOptions ? filterPickedValues({ data: parsedData, value: _value }) : parsedData
hidePickedOptions ? filteredData : parsedData
}
hidden={readOnly || disabled}
filter={filter}
search={_searchValue}
limit={limit}
hiddenWhenEmpty={
hidePickedOptions ||
!searchable ||
!nothingFoundMessage ||
(!searchable && _searchValue.trim().length !== 0)
(hidePickedOptions && filteredData.length === 0 && _searchValue.trim().length === 0)
}
withScrollArea={withScrollArea}
maxDropdownHeight={maxDropdownHeight}
Expand Down

0 comments on commit e9eaf9b

Please sign in to comment.