Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native Input Autofill

I was wondering if anyone knows if 1. this is possible with react native and 2. how would I go about achieving this. It's nothing too crucial to the application but it's something nice to have. I want to display a users (ios) predetermined phone number contact information above the keyboard when focusing on the input.Here is a picture about what Im talking about shown in safari and other apps. This first image is from Instagram which shows the user email above This second one is from safari, which shows the phone numbers, which is want i want to achieve

This is the code I have for my phone number input

<TextInput
  keyboardType="decimal-pad"
  placeholder="Phone Number"
  placeholderTextColor="#555555"
  returnKeyType="next"
  selectionColor="#FF5349"
  textContentType="username"
/>
like image 569
Daniel Jimenez Avatar asked Nov 02 '25 06:11

Daniel Jimenez


1 Answers

autoCompleteType

Specifies autocomplete hints for the system, so it can provide autofill. On Android, the system will always attempt to offer autofill by using heuristics to identify the type of content. To disable autocomplete, set autoCompleteType to off.

<TextInput
  autoCompleteType="tel" // <-- suggestion for telephone autocompletion
  keyboardType="decimal-pad"
  placeholder="Phone Number"
  placeholderTextColor="#555555"
  returnKeyType="next"
  selectionColor="#FF5349"
  textContentType="username"
/>
like image 195
Drew Reese Avatar answered Nov 04 '25 20:11

Drew Reese



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!