Skip to content
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

Overflow menu needs to be navigable using arrow keys #1233

Closed
carmacleod opened this issue Oct 11, 2018 · 10 comments
Closed

Overflow menu needs to be navigable using arrow keys #1233

carmacleod opened this issue Oct 11, 2018 · 10 comments

Comments

@carmacleod
Copy link
Contributor

As a follow-on to #666:

  • down and up arrows should move through the menu items
  • ideally, the menu should also open on down arrow (move focus to first item) and up arrow (move focus to last item)
  • since the menu items are semantically buttons (i.e. they perform an action when activated) and not links (i.e. they do not navigate to a new page when activated) they should only be traversable with down/up arrow, and not tab
@carmacleod
Copy link
Contributor Author

@tw15egan Actually, I would label this as a bug. :)
Note that Dropdown does handle arrow keys - not sure if some of that code can be reused.

@johnharan
Copy link

@carmacleod Hi Carolyn, in #666 you mentioned "the menu should open on space and optionally down and/or up arrow (not just enter)". Looking at http://www.carbondesignsystem.com/components/overflow-menu/code the space key does not seem to have same behavior as enter key, is this behavior correct? should we expect the space key to behave same as enter key?

@carmacleod
Copy link
Contributor Author

Hi @johnharan. Space and enter do work exactly the same for me. I'm on Windows 7.
The behavior is that they both open the overflow menu and place focus on the first item.

Are you on a Mac? I can't test on a Mac until this evening.

@johnharan
Copy link

johnharan commented Nov 14, 2018

@carmacleod I've tested some more, and it appears that the issue is only on firefox.
On firefox it seems the space key must be pressed and held to keep the menu open, and the space key also causes the page to scroll. On chrome/IE/safari the space key seems to behave the same as enter.

Edit: It seems for our team's implementation, space is causing the page to scroll in chrome as well as firefox.

@carmacleod
Copy link
Contributor Author

To stop the page from scrolling, your key event handler needs to have event.preventDefault();
It wouldn't hurt to call event.stopPropagation(); as well.
That may help fix the weird behavior on FF as well (not sure). (Let me know :)

See also: #1398 for the Esc key.

@carbon-bot
Copy link
Contributor

🎉 This issue has been resolved in version 9.68.8 🎉

The release is available on:

Your semantic-release bot 📦🚀

@carmacleod
Copy link
Contributor Author

Awesome! Thanks!

@lauraalkhoury
Copy link

Fantastic! Will update our version to pick up the fix. @asudoh will this fix also be ported to carbon-components-react or should i open a separate issue there?

@emyarod
Copy link
Member

emyarod commented Jan 24, 2019

@lauraalkhoury there is a ticket opened by @carmacleod in the React repo about this issue already https://github.com/IBM/carbon-components-react/issues/1741, and I'm looking to resolve it soon

@ChunxiAlexLuo
Copy link

@lauraalkhoury there is a ticket opened by @carmacleod in the React repo about this issue already https://github.com/IBM/carbon-components-react/issues/1741, and I'm looking to resolve it soon

Has this issue also already been resolved in carbon-components-react?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants