I am trying to disable the autocomplete on the web using TextInput from react-native-paper 3.10.1
<TextInput
name="city"
textContentType="addressCity"
autoComplete="off"
mode="outlined"
/>
The autoComplete="off" is replaced with autocomplete="noop" in the rendered HTML, which cause the auto complete not to be disabled.

From where does the noop come from and how can I disable the autocomplete?
https://snack.expo.io/@kopax/curious-pizza
TextInput in react-native-web API says it follows The HTML autocomplete attribute, but it doesn't work. It does however seem to follow aria-autocomplete.
The TextInput in react-native follows it's own API. But there's this issue that renamed the prop in react native from autoCompleteType to autoComplete. So at the time of writing the React Native docs also need to be updated.
The solution:
<TextInput
autoComplete={ Platform.OS === 'web' ? 'none' : 'off' }
Tested in:
expo: 42.0.4
react-native: 0.63.2 (https://github.com/expo/react-native/archive/sdk-42.0.0.tar.gz)
react-native-web (version): 0.13.18
react: 16.13.1
Browser: Chrome 96.0.4664.110
The prop you need to pass is autoCompleteType='off'. You can find more information on the props for the react-native provided TextInput component (who's props React Native Paper's TextInput also extends) here. https://reactnative.dev/docs/textinput.html#autocompletetype
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With