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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Native button should trigger click on keydown space #406
Comments
That makes sense to me, though I think having a modifier (like |
just to add to this convo, I have a test right now with an element that has There's nothing I can find in the ARIA Edit: Side note, I do not hit that error when doing |
what you're saying is regarding the other issue opened by @visualjerk #407 |
I would be glad to add support for it. Just to be clear: I would expect that Do you have any objections against that? |
I think that the behaviour should be different because |
But you can't "add a value to a button" so I do think it would make sense that they do the same thing when triggered on a button. |
I think that I can do The value is sent when a form is submitted. Am I'm wrong? |
@marcosvega91 yeah that works but pressing space on that button wouldn't change the value of the button to |
from a user perspective I think that is not possible to add a value to a button, at the same time value property is valid on button, so I think that in I can do this |
I will handle the case |
For now every element that can have a value property are valid I think. Because we simulate user interactions on a browser user can't write in a button but at the same time can press a space on a button. I think that we should skip code that add value in the |
Whatever we do, let's just make sure it results in the same events that are fired when the user does that interaction in the browser: https://codesandbox.io/s/user-event-playground-eo909 |
I'll do a little recap. I hope to do a right thing 馃Ω We have two things to consider:
For now I think that we can simply implement the |
Thanks for the recap! If it is okay for you, I would try to also correct the bug in the same PR. Actually a button is not the only element that has a We also need to consider als
I will include these in the fix as well. |
That sounds great 馃憤 |
馃帀 This issue has been resolved in version 12.0.13 馃帀 The release is available on:
Your semantic-release bot 馃摝馃殌 |
For of all, thank you for this handy library 馃槃
@testing-library/user-event
version: 12.0.11Relevant code or config
Reproduction repository:
https://codesandbox.io/s/angry-bas-bttix?file=/src/user-event.test.js
Problem description:
A native button triggers a click event on keydown space.
Currently only keydown enter is handled properly by
userEvent.type
.Suggested solution:
Add the same behavior that keydown enter has for keydown space.
The text was updated successfully, but these errors were encountered: