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
Cursor position is changed while using userEvent.keyboard #664
Comments
Thanks a lot for the report. This problem seems to be specific to controlled React inputs. Uncontrolled input works fine. A quick investigation points towards a problem with the implementation of But React seems to move the cursor on the user-event/src/keyboard/shared/fireInputEvent.ts Lines 35 to 41 in 1560b29
It might be better to only skip reapplying the selection range when we detect an unreliable empty value. |
Yup no problem! Thanks for the prompt response @ph-fritsche. So a question I have for you is, how do we move this ticket forward? Is there a process to it? Also would be interested to look into helping out with this bug if I have enough time left over from my own project, and the necessary support to complete it b/c I have actually never contributed to open source projects before. |
@codepath2019 I've opened a PR with a potential fix in #665 |
@ph-fritsche I looked at your PR. Since I am unfamiliar with this code base, I don't know how to help out with the review process. When you tagged me above, did you have specific tasks in my mind for me to do? For example, pulling your code and running the new unit test locally? |
@codepath2019 You've already helped a lot with your report. ❤️ The way this code base grew and tests were added based on findings in issues rather than following some spec - the main concern with every change is to break some edge cases that are not covered by tests because previous implementation solved them as unintended or at least undocumented side-effect. |
@all-contributors add @codepath2019 bug |
I've put up a pull request to add @codepath2019! 🎉 |
🎉 This issue has been resolved in version 13.1.8 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Hello, thank you to testing-library team in advance for taking a look at my issue here. I believe this is a bug and would appreciate your help in understanding how to move forward on this issue.
Configuration
Relevant Code
Expectation
I expect that the cursor position would be 2 after the user hits the character 'b' immediately after the selectionStart had been set to 1.
Actual
The cursor position was set to 4 instead.
Reproduction repository
https://github.com/codepath2019/user-event-bug-report
or you can reference this PR commit, codepath2019/user-event-bug-report@2ff6d97
The text was updated successfully, but these errors were encountered: