-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
iOS Keyboard Autofill/SecureTextEntry makes content jump/glitch when focusing on next TextInput #31722
Comments
UPDATE: I made another example: simple-keyboard-autofill-issue-2 In this example, I have 4 TextInput with only The first two TextInput are focusing each other on "return" press, no problem with those two, like it should be. The last two TextInput are also focusing each other on "return" press, the bug/jump/glitch happens with both TextInput. I really think the bug is caused by the Autofill Passwords feature on iOS. Here's a screen recording of the new snack example, taken from an iPhone 11 Pro with iOS 14.6: RPReplay_Final1623798783.MP4 |
UPDATE 2: I made yet another example: keyboardavoidingview This time I used the example provided right in the KeyboardAvoidingView documentation on reactnative.dev, added the same props from my other examples; focus on Once again, If I remove the secureTextEntry prop from the last input(line 27), the bug/jump/glitch no longer occurs. Here's a screen recording of the this snack example, taken from an iPhone 11 Pro with iOS 14.6: RPReplay_Final1623807401.MP4 |
@samuelbeaulieu did you find any solution? I am facing the same issue. |
@vvdodiya I did not. I'll keep you/this issue updated if I do. If you find something, please keep me updated too. |
same issue... |
Maybe it'll help somebody, but I decided to use IQKeyboardManager for iOS, and this for android, to be exact I've set |
this seems like a regression right? I'm getting the same issue but I used to use this pattern in older versions of react native without this occurring. |
I have the same problem. |
Hi |
I can confirm this solved the issue. |
I worked around this in a creative way...
It keeps the password in a state hook and censors it manually to ***. It might not look super clean but it's one way to solve it |
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
This issue was closed because it has been stalled for 7 days with no activity. |
Description
I have a page in my app with two TextInput inside views covering the whole screen.
The two TextInput have a ref
ref={refTextInput1}
,ref={refTextInput2}
.They also have a onSubmitEditing
onSubmitEditing={() => refTextInput2().current.focus()}
,onSubmitEditing={() => refTextInput1().current.focus()}
.So, when I press "return" on the keyboard, the focus will switch to the desired input but it's also making the whole screen jump/glitch which is really annoying and not wanted.
The focus should switch to the desired input without making the whole screen jump/glitch.
I searched everywhere on StackOverflow and Github Issues but didn't find a lot of issues with this particular problem.
At first, I thought I had a problem similar to #30207, but after a while trying to find the problem, I think I found it.
The problem only occurs(I think) when Autofill Passwords is enabled in Settings>Passwords>Autofill Passwords.
If I disable Autofill Passwords, the jump/glitch does not occurs.
I also noticed that the keyboard event is always triggered twice on focus with Autofill Passwords enabled, and only once on focus with Autofill Passwords disabled. It may also be related. (See the console when running the snack example.)
I looked at other apps, and they all seems fine in the same type of login screen. Instagram for example doesn't have this problem.
It might also be the way I made my screen, if there's a better way to do the same or similar screen, I would be open to suggestions.
React Native version:
Steps To Reproduce
I also noticed that the keyboard event is always triggered twice on focus with Autofill Passwords enabled, and only once on focus with Autofill Passwords disabled. It may also be related. (See the console when running the snack example.)
Expected Results
When pressing "return" on the keyboard, the focus should switch to the desired input without making the whole screen jump/glitch. Like when Autofill Passwords is disabled in Settings>Passwords>Autofill Passwords.
Snack, code example, screenshot, or link to a repository:
Snack 1 is a simpler version of my issue.
Snack 1: simple-keyboard-autofill-issue
Snack 2 is closer to what I really have in my app.
Snack 2: my-app-keyboard-autofill-issue
Minimal code example: (from simple-keyboard-autofill-issue)
Here you can see the screen recording taken from an iPhone 11 Pro with iOS 14.6: (Note that secureTextEntry was temporarily disabled while screen recording, the problem is still present)
RPReplay_Final1623718912.MP4
The text was updated successfully, but these errors were encountered: