From ea564fdde51149da3f99fdde5b1654d63dc5ab16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oddbj=C3=B8rn=20=C3=98vernes?= Date: Wed, 20 Nov 2024 12:43:00 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Autocomplete:=20undefined=20para?= =?UTF-8?q?m=20in=20optionDiabled=20(#3689)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../eds-core-react/src/components/Autocomplete/Autocomplete.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/eds-core-react/src/components/Autocomplete/Autocomplete.tsx b/packages/eds-core-react/src/components/Autocomplete/Autocomplete.tsx index db5594c470..9d431b4620 100644 --- a/packages/eds-core-react/src/components/Autocomplete/Autocomplete.tsx +++ b/packages/eds-core-react/src/components/Autocomplete/Autocomplete.tsx @@ -467,7 +467,7 @@ function AutocompleteInner( const allDisabled = enabledItems.length === 0 const selectedDisabledItemsSet = useMemo( - () => new Set(selectedItems.filter(optionDisabled)), + () => new Set(selectedItems.filter((x) => x !== null && optionDisabled(x))), [selectedItems, optionDisabled], )