committed by
GitHub
parent
93991680a7
commit
b3b594efcd
@ -46,7 +46,9 @@ export const MultiSelectFieldInput = ({
|
|||||||
fieldValues?.includes(option.value),
|
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 formatNewSelectedOptions = (value: string) => {
|
||||||
const selectedOptionsValues = selectedOptions.map(
|
const selectedOptionsValues = selectedOptions.map(
|
||||||
@ -87,7 +89,7 @@ export const MultiSelectFieldInput = ({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const optionIds = optionsInDropDown.map((option) => option.value);
|
const optionIds = filteredOptionsInDropDown.map((option) => option.value);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SelectableList
|
<SelectableList
|
||||||
@ -95,7 +97,7 @@ export const MultiSelectFieldInput = ({
|
|||||||
selectableItemIdArray={optionIds}
|
selectableItemIdArray={optionIds}
|
||||||
hotkeyScope={hotkeyScope}
|
hotkeyScope={hotkeyScope}
|
||||||
onEnter={(itemId) => {
|
onEnter={(itemId) => {
|
||||||
const option = optionsInDropDown.find(
|
const option = filteredOptionsInDropDown.find(
|
||||||
(option) => option.value === itemId,
|
(option) => option.value === itemId,
|
||||||
);
|
);
|
||||||
if (isDefined(option)) {
|
if (isDefined(option)) {
|
||||||
@ -112,7 +114,7 @@ export const MultiSelectFieldInput = ({
|
|||||||
/>
|
/>
|
||||||
<DropdownMenuSeparator />
|
<DropdownMenuSeparator />
|
||||||
<DropdownMenuItemsContainer hasMaxHeight>
|
<DropdownMenuItemsContainer hasMaxHeight>
|
||||||
{optionsInDropDown.map((option) => {
|
{filteredOptionsInDropDown.map((option) => {
|
||||||
return (
|
return (
|
||||||
<MenuItemMultiSelectTag
|
<MenuItemMultiSelectTag
|
||||||
key={option.value}
|
key={option.value}
|
||||||
|
|||||||
Reference in New Issue
Block a user