Skip to content

fix: replace autofill string in textfield #9555

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

janoshrubos
Copy link
Contributor

PR Checklist

What is the current behavior?

On iOS if we type a few character and use the auto-fill function it will concat the strings instead of replacing to the suggested one.
Video example in the issue: #9486

What is the new behavior?

After typing the the start of an e-mail and tap on auto-fill, it will replace the text.

Note:
The solution is based on the string's delta, which means if we copy and paste a text to a textfield, it will behave like we used auto-fill and replace the text in the view model.

Fixes #9486

@20051231
Copy link

seems this pull request breaks emoji keyboard input since emoji characters are longer than 1 in js
if user input multiple emojis in a row, only one emoji is kept since the whole string is replaced every time.

The below line is not enough to detect autofill or keyboard

const shouldReplaceString = (textField.secureTextEntry && this.firstEdit) || delta > 1;

@farfromrefug
Copy link
Collaborator

@20051231 good catch. could you open an issue so we can follow this issue ?

@vetter99
Copy link

vetter99 commented Mar 9, 2022

opened an issue since i didnt see one: #9816

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[iOS] wrong form data value when using autocomplete (playground demo included)
5 participants