Android - TextInput Autofill not working
See original GitHub issue“react-native”: “0.61.4” "react-native-screens: “2.0.0-alpha.5”
It seems that the library blocks the native autofill suggestions view. Also, there is no save password dialog after a successful login. (This dialog is auto popped-up by the Android framework).
<TextInput
placeholder={'Username'}
autoCompleteType={'email'}
/>
<TextInput
placeholder={'Password'}
autoCompleteType={'password'}
secureTextEntry={true}
/>
Setting those props should be enough to trigger the autofill mechanism.
What we tried and did not work:
- Update to a library version after the PR from #205 was merged.
- Set the TextInput width to 99% on first render and then to 100%, as suggested
- Set the TextInput editable prop to false on first render and then on true, as suggested
Issue Analytics
- State:
- Created 4 years ago
- Reactions:19
- Comments:38 (13 by maintainers)
Top Results From Across the Web
Optimize your app for autofill - Android Developers
The autofill framework saves user input for future use by showing a "Save for autofill?" dialog after the autofill context is finished.
Read more >android - EditText AutoCorrect and AutoComplete not working
I was having some problems with auto-correction and it seems that textAutoComplete means that the input will be automatically completed ...
Read more >react-native-autocomplete-input - npm
Start using react-native-autocomplete-input in your project by running `npm i react-native-autocomplete-input`. There are 13 other projects ...
Read more >Cant turn off autocomplete in Textinput (Android) : r/reactnative
When user tries to log in into his account, if the email is typed manually, the authentication works with no problem. Also, if...
Read more >Working with the EditText | CodePath Android Cliffnotes
Working with the EditText. Edit PagePage History. Overview. The EditText is the standard text entry widget in Android apps. If the user needs...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I had the same issue on Android devices and accidentaly realized that it works as expected when I use state to mount the TextInput right after mouting the screen component.
example:
I’m using
"react-native-screens": "~3.0.0"
and react-navigation v5 with expo sdk 41 (React Native 0.63). Also I have calledenableScreen(true)
and the TextInput is inside the ScrollView.I have no idea why it solves the issue but at least it’s working for me right now. I hope this helps on the other versions.
I have suffered a lot to implement this in iOS successfully:
However, in Android there is little information and I think that it is not very successful:
autoCompleteType = {'password'}
andimportantForAutofill = {'yes' }
.react-native-screens
and its enableScreens method, which has not worked for me with either true or false.I don’t know what to do, these kinds of problems that always happen with React Native make me desperate. Normally you have more problems and it is more complicated with iOS, but in this case I think not, in my case.