-
Notifications
You must be signed in to change notification settings - Fork 828
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
md-menu-item of type="button" should click on keyboard selection #5577
Comments
I think the culprit is the menu item controller's keydown handler, which stops the space/enter keydowns from making a click. @e111077 may know a bit more about that controller, but that'd be a good place to start debugging. |
The initial reasoning is that a click will cause the menu to close / open submenu via click selection. This would then likely trigger the close twice and cause some visual jank. Additionally, by marking it as We might be able to add some likely non-trivial logic / rewrite here to solve this. Perhaps another marker other that |
Description
In the same way that a click is triggered for anchors on keyboard selection, I would expect the same to apply for buttons as well. However that is not the case. Instead, you have to handle the close-menu event manually to produce the same effect.
Compare between using mouse and keyboard to select from two kinds of menu:
Example Playground
Also notice how anchors only get clicked on Enter but not Space which matches their native behavior but not so much the menu spec. The inconsistency irks me a bit but meh. As an aside, I feel like handling selection from a menu is the most essential part of using it so there should be an easier way to go about all this.
The text was updated successfully, but these errors were encountered: