diff --git a/UNRELEASED.md b/UNRELEASED.md index ded8244481d..2f2fe033b3f 100644 --- a/UNRELEASED.md +++ b/UNRELEASED.md @@ -19,6 +19,7 @@ Use [the changelog guidelines](https://git.io/polaris-changelog-guidelines) to f - Fixed `errorOverlayText` on `Dropzone` ([#671](https://github.com/Shopify/polaris-react/pull/671)) - Updated the `InlineError` text color, the error border-color on form fields and the error `Icon` color to be the same red. ([#676](https://github.com/Shopify/polaris-react/pull/676)) - Fixed `AppProvider` server side rendering support ([#696](https://github.com/Shopify/polaris-react/pull/696)) (thanks [@sbstnmsch](https://github.com/sbstnmsch) for the [original issue](https://github.com/Shopify/polaris-react/issues/372)) +- Fixed `TextField` autocomplete disabling by setting autocomplete="nope" when `autoComplete` prop is `false` ([#708](https://github.com/Shopify/polaris-react/pull/708)) ### Documentation diff --git a/src/components/TextField/TextField.tsx b/src/components/TextField/TextField.tsx index 7dcb0a6d0de..0e85bc7248b 100644 --- a/src/components/TextField/TextField.tsx +++ b/src/components/TextField/TextField.tsx @@ -386,5 +386,5 @@ function normalizeAutoComplete(autoComplete?: boolean) { if (autoComplete == null) { return autoComplete; } - return autoComplete ? 'on' : 'off'; + return autoComplete ? 'on' : 'nope'; } diff --git a/src/components/TextField/tests/TextField.test.tsx b/src/components/TextField/tests/TextField.test.tsx index d4d707a6199..d7568db8e66 100644 --- a/src/components/TextField/tests/TextField.test.tsx +++ b/src/components/TextField/tests/TextField.test.tsx @@ -151,11 +151,11 @@ describe('', () => { expect(textField.find('input').prop('autoComplete')).toBeUndefined(); }); - it('sets autoComplete to "off" when false', () => { + it('sets autoComplete to "nope" when false', () => { const textField = shallowWithAppProvider( , ); - expect(textField.find('input').prop('autoComplete')).toBe('off'); + expect(textField.find('input').prop('autoComplete')).toBe('nope'); }); it('sets autoComplete to "on" when false', () => {