Skip to content

Commit

Permalink
Fixes multi-select search not working ( #6800 ) (#6964)
Browse files Browse the repository at this point in the history
fixes #6800
  • Loading branch information
Faisal-imtiyaz123 authored Sep 10, 2024
1 parent 9399168 commit b3b594e
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ export const MultiSelectFieldInput = ({
fieldValues?.includes(option.value),
);

const optionsInDropDown = fieldDefinition.metadata.options;
const filteredOptionsInDropDown = fieldDefinition.metadata.options.filter(
(option) => option.label.toLowerCase().includes(searchFilter.toLowerCase()),
);

const formatNewSelectedOptions = (value: string) => {
const selectedOptionsValues = selectedOptions.map(
Expand Down Expand Up @@ -87,15 +89,15 @@ export const MultiSelectFieldInput = ({
},
});

const optionIds = optionsInDropDown.map((option) => option.value);
const optionIds = filteredOptionsInDropDown.map((option) => option.value);

return (
<SelectableList
selectableListId={MULTI_OBJECT_RECORD_SELECT_SELECTABLE_LIST_ID}
selectableItemIdArray={optionIds}
hotkeyScope={hotkeyScope}
onEnter={(itemId) => {
const option = optionsInDropDown.find(
const option = filteredOptionsInDropDown.find(
(option) => option.value === itemId,
);
if (isDefined(option)) {
Expand All @@ -112,7 +114,7 @@ export const MultiSelectFieldInput = ({
/>
<DropdownMenuSeparator />
<DropdownMenuItemsContainer hasMaxHeight>
{optionsInDropDown.map((option) => {
{filteredOptionsInDropDown.map((option) => {
return (
<MenuItemMultiSelectTag
key={option.value}
Expand Down

0 comments on commit b3b594e

Please sign in to comment.