TL;DR: Introduce a new prop for TextInput component to configure autocomplete/autofill options in a cross-platform fashion.

Long Story:

iOS already supports some degree of auto completion through the usage of textContentType property (and recently added username and password options).

Android Oreo introduced the AutoFill Framework, for secure communication between an app and autofill services (e.g. Password managers). It introduces two new properties for text input elements (TextEdit, Spinner and alikes): autofillHints (accepting constants that range from username and password to credit card number) and importantForAutofill (in short, turn it on or off).

Out-of-the-box, Android Oreo+ already tries to autofill <TextInput> components in React Native apps based on heuristics (on the placeholder text, for example), but there is no way to actually set configuring options.

The quick solution would be to just add an autofillHints property in React Native TextInput, but that doesn't bond well with the cross-platform nature of the library.

Proposal: Adopt HTML's autocomplete attribute. HTML's autocomplete spec can be mapped to Android autofillHints & importantForAutofill and serves as a proper placeholder for autofill/autocomplete in other platforms.


Android AutoFill Framework documentation:

HTML autocomplete attribute spec:

Related Feature Request:

Related issue / feature request: facebook/react-native#17097