diff --git a/.changeset/rotten-moons-build.md b/.changeset/rotten-moons-build.md new file mode 100644 index 00000000000..e063ca2eac2 --- /dev/null +++ b/.changeset/rotten-moons-build.md @@ -0,0 +1,5 @@ +--- +"@navikt/ds-react": patch +--- + +Combobox: Disable autocomple in Firefox on Android to prevent bug diff --git a/@navikt/core/react/src/form/combobox/ComboboxProvider.tsx b/@navikt/core/react/src/form/combobox/ComboboxProvider.tsx index 402445e43df..4845f5f254d 100644 --- a/@navikt/core/react/src/form/combobox/ComboboxProvider.tsx +++ b/@navikt/core/react/src/form/combobox/ComboboxProvider.tsx @@ -51,13 +51,21 @@ const ComboboxProvider = forwardRef( value, onChange, onClear, - shouldAutocomplete, + shouldAutocomplete: externalShouldAutocomplete, size, ...rest } = props; const options = mapToComboboxOptionArray(externalOptions) || []; const filteredOptions = mapToComboboxOptionArray(externalFilteredOptions); const selectedOptions = mapToComboboxOptionArray(externalSelectedOptions); + + const userAgent = + typeof navigator === "undefined" ? "" : navigator.userAgent; + const isFirefoxOnAndroid = + userAgent.includes("Android") && userAgent.includes("Firefox/"); + const shouldAutocomplete = + !isFirefoxOnAndroid && externalShouldAutocomplete; + return (