-
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
Add cursor position to textInput onChange event #35616
Conversation
Hi @Karim-30! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
Base commit: 0f089ea |
Base commit: 0f089ea |
PR build artifact for 19f7106 is ready. |
PR build artifact for 19f7106 is ready. |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
Instead of adding another non-standard API, perhaps we should implement the selection properties from the "reduce API fragmentation" RFC. That would mean adding |
There Is no const cursor = event.nativeEvent.selection?.start || event.target.selectionStart We should give the developer a single property representing the cursor location inside the |
|
This PR 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 PR was closed because it has been stalled for 7 days with no activity. |
Summary
Somethimes we need to know where is the cursor inside the
Textinput
, unfortunately onChangeText only give us the text inside theTextInput
and it receives a string (changing a string to an object isn't a good idea).onChange callback receives an object so we can add the cursor position to it.
Changelog
[GENERAL] [ADDED] - Add cursor position to textInput onChange event
Test Plan
Screen.Recording.2022-12-12.at.6.38.04.PM.mov