-
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: setSelection methods is always returned. #17894
[Android] Fix: setSelection methods is always returned. #17894
Conversation
Because mMostRecentEventCount < mNativeEventCount is always true as mMostRecentEventCount is not updated. So determine whether text is set or not from getting current text. Also handle out of bound selection.
@facebook-github-bot label Needs more information @facebook-github-bot label Android Generated by 🚫 dangerJS |
Thanks! @facebook-open-source-bot I have updated and included Test Plan. 👍 :) |
hi @janicduplessis please review this PR too. :) |
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.
How removing mMostRecentEventCount
can fix the problem which mMostRecentEventCount
is supposed to address?
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.
@jainkuniya do you have any updates for this pull request? It's been a while since the last update so wanted to check in and see if you've looked at the requested changes. |
Yeah this doesn't seem like the solution we are looking for here. I'm gonna close this PR. |
Motivation
Because mMostRecentEventCount < mNativeEventCount is always true as mMostRecentEventCount is not updated.
So determine whether text is set or not from getting current text. Also handle out of bound selection.
Test Plan
Use this component to test with & without this PR
Before this PR, on clicking Button, nothing will happen.
On this PR: text will be selected starting from 0 and ending at 3. (Just for testing I have barcoded
start
&end
value)Just created a component to test (below).
Current behaviour
This PR
Release Notes
[ANDROID] [BUGFIX] [TextInput] Fix: setSelection methods is always returned.