diff --git a/packages/react-native-web/src/exports/TextInput/__tests__/index-test.js b/packages/react-native-web/src/exports/TextInput/__tests__/index-test.js index 44b5ebac..d98a9d0f 100644 --- a/packages/react-native-web/src/exports/TextInput/__tests__/index-test.js +++ b/packages/react-native-web/src/exports/TextInput/__tests__/index-test.js @@ -25,7 +25,12 @@ describe('components/TextInput', () => { test('value "off"', () => { const input = findNativeInput(shallow()); - expect(input.prop('autoComplete')).toEqual('noop'); + expect(input.prop('autoComplete')).toEqual('off'); + }); + + test('autoCompleteType fallback', () => { + const input = findNativeInput(shallow()); + expect(input.prop('autoComplete')).toEqual('off'); }); }); diff --git a/packages/react-native-web/src/exports/TextInput/index.js b/packages/react-native-web/src/exports/TextInput/index.js index 0f334b0f..f1e3c729 100644 --- a/packages/react-native-web/src/exports/TextInput/index.js +++ b/packages/react-native-web/src/exports/TextInput/index.js @@ -95,7 +95,8 @@ class TextInput extends React.Component { render() { const { autoCapitalize = 'sentences', - autoComplete = 'on', + autoComplete, + autoCompleteType, autoCorrect = true, autoFocus, defaultValue, @@ -144,9 +145,7 @@ class TextInput extends React.Component { Object.assign(supportedProps, { autoCapitalize, - // Browser's treat autocomplete "off" as "on" - // https://bugs.chromium.org/p/chromium/issues/detail?id=468153#c164 - autoComplete: autoComplete === 'off' ? 'noop' : autoComplete, + autoComplete: autoComplete || autoCompleteType || 'on', autoCorrect: autoCorrect ? 'on' : 'off', autoFocus, classList: [classes.textinput], diff --git a/packages/react-native-web/src/exports/TextInput/types.js b/packages/react-native-web/src/exports/TextInput/types.js index df5dbf7e..31d78ea4 100644 --- a/packages/react-native-web/src/exports/TextInput/types.js +++ b/packages/react-native-web/src/exports/TextInput/types.js @@ -21,6 +21,7 @@ export type TextInputProps = { ...ViewProps, autoCapitalize?: 'characters' | 'none' | 'sentences' | 'words', autoComplete?: string, + autoCompleteType?: string, // Compat with React Native (Bug react-native#26003) autoCorrect?: boolean, autoFocus?: boolean, blurOnSubmit?: boolean,