-
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
typing fails if input matches selection #583
Comments
This is probably caused by |
Hi @ph-fritsche 👋 What is reasoning behind not firing input events if Is this a generalization which is mostly true for how the browser decides to fire I can see an input event is fired when replicating the issue in the sandbox. issue-583-sandbox-clip.mp4Removing the rule will result in input events being fired in many scenarios where they shouldn't (see snapshots of commit referenced below). |
@fergusmcdonald Thanks for taking the time to look into this. 😃
This is one of the parts of which I'm not sure yet, why they were implemented the way they are.
When rewriting the implementation for |
@ph-fritsche - This condition may have originated from the following spec: https://html.spec.whatwg.org/multipage/input.html#common-input-element-events
|
Yes, a misunderstanding of that paragraph might be the reason. There is no |
There is no user-event/src/keyboard/plugins/character.ts Lines 109 to 114 in 74d191c
|
There is also no |
* wip: clean up fireInputEvent helper * fix(type): setSelectionRange on elements without selectionRange * refactor: maxLength * test: demonstrate #583 * fix: refactor calculateNewValue * fix: relative imports
@fergusmcdonald Thanks for starting the work on this. The main problem is solved now. But there are still a few edge cases that might need investigation. |
🎉 This issue has been resolved in version 13.0.14 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
I have found what I believe to be a related issue to this one, which is documented in this CodeSandbox: https://codesandbox.io/s/userevent-unit-test-ncmgu?file=/src/App.test.js
Setup of the tested component
'1'
)HTMLInputElement.select()
method on input focus so every new value completely overwrites the previous oneTest execution:
userEvent.type(...
(ex:'11123'
)'23'
and not'11123'
Originally posted by @psullivan6 in #521 (comment)
The text was updated successfully, but these errors were encountered: