-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
[Android] Fix TextInput Cursor jumping to the right when the placeholder null #28995
Conversation
Base commit: 7b09eb5 |
Base commit: 7b09eb5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tested this code and it works perfect please merge it
Why has this not been merged yet? |
cc @JoshuaGross |
@Haris-Shahid i'll test again, but it worked when I wrote this pr... |
when will this be merged? |
Did you test it works by any chance? It didn't fix the issue for me either with RN v0.63.4 :/ |
This comment has been minimized.
This comment has been minimized.
ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java
Outdated
Show resolved
Hide resolved
@fabriziobertoglio1987 I've noticed you just updated this PR recently. Any chance of this getting merged soon. This also just seems to happen when textAlign is set to |
@lunaleaps has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
@lunaleaps merged this pull request in 3560753. |
Wow finally after 2 years, folks at facebook merged this PR 😳🤦 |
In which version of react-native it will work fine? |
|
Summary
This issue fixes #28794 fixes #27658
Flow type ?Stringish allows to set the placeholder value to null. The null value causes the cursor to jump to the right in a TextInput. The fix replaces the placeholder null value with an empty string which avoid calling setHint(null) as causes the placeholder to jump to the right.
Changelog
[Android] [Fixed] - avoid calling setHint with a null parameter causing cursor to jump to the right
Test Plan
CLICK TO OPEN TESTS RESULTS (28 May 2020 20a9473)
More videos and information included in issue #28794
The below test cases are from the following repository
Extensive testing on
RNTester
did not identify any regression.CLICK TO OPEN TESTS RESULTS (15 February 2021 20a9473)
2021-02-15.15-48-54.mp4
2021-02-15.15-44-55.mp4