-
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
[Android][TextInput] onSelectionChange can have end < start #18579
Comments
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions. |
Not fixed AFAIK |
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions. |
Not fixed AFAIK |
Using this code I was able to repro the issue on 0.59:
|
This issue can probably be fixed with this change. I don't have my build environment set up so if someone wants to create a PR and test this change, that would be great:
|
I am a new to open source contributing and would like to work on this issue. |
I am attempting to set up a build environment but am getting the following problem during the build: 'org.gradle.process.internal.ExecException: Process 'command 'C:\Users\Daniel\AppData\Local\Android\android-ndk-r19c\ndk-build.cmd'' finished with non-zero exit value 2' which appears similar to this issue from 2015: #3107. |
+1 |
@TheSavior |
Summary: Fixes facebook#18579 Normalize `start` and `end` arguments when `onSelectionChange` is dispatched on Android. It just applies a [fix](facebook#18579 (comment)) sent by TheSavior (Thanks, by the way 😄) ## Changelog [Android] [Fixed] - fix(android): Normalize start and end args Pull Request resolved: facebook#24938 Differential Revision: D15412005 Pulled By: cpojer fbshipit-source-id: bb132313cfb8877a682f3865a5f9e48d45ac20ac
If one has a
TextInput
and selects from right to left, on Android the selection ononSelectionChange
hasend < start
. On iOS,start <= end
consistently.Environment
Environment:
OS: macOS High Sierra 10.13.3
Node: 9.9.0
Yarn: 1.5.1
npm: 5.8.0
Watchman: 4.9.0
Xcode: Xcode 9.2 Build version 9C40b
Android Studio: Not Found
Packages: (wanted => installed)
react: 16.3.0-alpha.1 => 16.3.0-alpha.1
react-native: 0.54.2 => 0.54.2
Steps to Reproduce
See https://snack.expo.io/BJUeRfw5M which is for another bug. On a regular simulator you can do shift-left to repro, but that doesn't seem to work on Snack. Instead, click and drag a word with your mouse from right to left. From the console logs, you'll see that end < start on Android. Alas, iOS on Snack doesn't seem to let you select from right to left, so you'll have to fire up the simulator for that. See https://github.com/akalin-keybase/rn-text-input-bugs instead.
Expected Behavior
start <= end
consistently.Actual Behavior
On Android the selection on
onSelectionChange
hasend < start
.The text was updated successfully, but these errors were encountered: