diff --git a/@navikt/core/react/src/form/combobox/SelectedOptions/selectedOptionsContext.tsx b/@navikt/core/react/src/form/combobox/SelectedOptions/selectedOptionsContext.tsx index a5ce0ea92c..ad0123b7af 100644 --- a/@navikt/core/react/src/form/combobox/SelectedOptions/selectedOptionsContext.tsx +++ b/@navikt/core/react/src/form/combobox/SelectedOptions/selectedOptionsContext.tsx @@ -101,12 +101,9 @@ const SelectedOptionsProvider = ({ [customOptions, onToggleSelected, removeCustomOption], ); - const isLimitReached = useMemo(() => { - return ( - (!!maxSelected?.limit && selectedOptions.length >= maxSelected.limit) || - (!isMultiSelect && selectedOptions.length > 0) - ); - }, [maxSelected, selectedOptions, isMultiSelect]); + const isLimitReached = + (!!maxSelected?.limit && selectedOptions.length >= maxSelected.limit) || + (!isMultiSelect && selectedOptions.length > 0); // biome-ignore lint/correctness/useExhaustiveDependencies: We explicitly want to run this effect when selectedOptions changes to match the view with the selected options. useEffect(() => {