-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
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
[Chip] Keyboard events regression #18236
Comments
You probably mean for |
The best way for me would be to call |
@AryamnovEugeniy what browser are you using? On macOS 10.14.6: Chrome 78.0.3904.70, Firefox 69.0.3, and Safari 13.0.3, the ButtonBase behaves like the native button for the Enter key and behaves the opposite for the Space key. |
I used Chrome 78.0.3904.87 and Firefox 69.0.3 and got the same behaviour: the ButtonBase behaves like the native button for the Enter key and behaves the opposite for the Space key. The problem for me is that the |
@AryamnovEugeniy Why is the order important in your case? |
Then this was a bug. click is supposed to fire before keyup for Enter keys. For space click needs to fire after keyup. |
Hello again, @oliviertassinari, sorry for late response. I have a certain event which is triggered on mouse click, space click or enter click. And it is desirable that this event should be triggered only once. In case |
This issue was introduced in #17829 and uncovered an underlying issue with our ButtonBase implementation. ExpansionPanel has the same issue. |
It seems that the problem was solved in #18319. |
|
Thank you very much for your quick responses!! |
Current Behavior 😯
The
onClick
event is fired after theonKeyDown
event and it is fired as many times asonKeyDown
instead of being fired only once after theonKeyUp
event. It seems that this is a regression because a similar bug has already been fixed (#12449).Expected Behavior 🤔
The
onClick
event should be fired once and only afteronKeyUp
as in the native button.Steps to Reproduce 🕹
4.6.0.
Chip
doesn't work correctlyhttps://codesandbox.io/s/create-react-app-fmq1b
4.5.2.
Chip
works as expected.https://codesandbox.io/s/create-react-app-8o25z
Steps:
Add the following code:
Your Environment 🌎
The text was updated successfully, but these errors were encountered: