-
Notifications
You must be signed in to change notification settings - Fork 252
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
fix(keyboard): maintain cursor position on controlled React input #665
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 3a2b99b:
|
Codecov Report
@@ Coverage Diff @@
## master #665 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 50 50
Lines 930 932 +2
Branches 366 367 +1
=========================================
+ Hits 930 932 +2
Continue to review full report at Codecov.
|
It looks like our fix in f51a7f8 also removed the need for this: user-event/src/keyboard/shared/fireInputEvent.ts Lines 55 to 60 in 99fab5a
|
🎉 This PR is included in version 13.1.8 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Woohoo! Thanks @ph-fritsche |
What:
Closes #664
Enforce the correct cursor position after input handling
Why:
We trick React into picking up the changes on the
input
event. React moves the cursor to the end of the input.How:
Also set the selection range if the value was not changed by an event handler.
Checklist: