HomePhabricator
Diffusion Comm 0c853385763b

[native] Add password autofill support to PasswordSelection

Description

[native] Add password autofill support to PasswordSelection

Summary:
This diff lets the user skip entering the password again for the "Confirm password" TextInput if the primary TextInput was autofilled.

Unfortunately this has to be different for iOS and Android. It's particularly important on Android, where for some reason the password autofill prompt doesn't even appear for the "Confirm password" TextInput.

  1. For iOS, we do what we currently do in RegisterPanel. We listen for onKeyPress events, and when we get a "key press" that is multiple characters we know that's a password autofill. iOS triggers onKeyPress like this for password autofill, but NOT for paste.
  2. On Android, onKeyPress is not triggered when a password is autofilled. Instead, we look for an onChangeText event that increases the length of the text by more than one character. This will trigger for paste events as well as for password autofill.

In both cases, we only modify the "Confirm password" TextInput if it's empty at the time the primary TextInput is modified.

Test Plan: I tested release builds on my physical iOS device and two physical Android devices (Pixel 3 running Android 12 and Pixel 6a running Android 13) with the 1Password app

Reviewers: atul, ginsu

Reviewed By: atul

Subscribers: tomek

Differential Revision: https://phab.comm.dev/D8002

Details

Provenance
ashoatAuthored on May 26 2023, 11:48 AM
Reviewer
atul
Differential Revision
D8002: [native] Add password autofill support to PasswordSelection
Parents
rCOMMe80f9ddc2a62: [native] Set RegistrationTextInput keyboardAppearance based on theme
Branches
Unknown
Tags
Unknown