question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Accessiblity: Navigation issues using keyboard on <Menu/>

See original GitHub issue

Describe the bug In <Menu/> component while navigating with keyboard if <MenuItem/> is or has Link inside it’s not navigating but onClick event gets triggered perfectly and clicking using mouse also works fine.

below is the example taken from https://chakra-ui.com/menu#usage

<Menu>
  <MenuButton as={Button} rightIcon="chevron-down">
    Actions
  </MenuButton>
  <MenuList>
    <MenuItem onClick={() => alert("Hello World!")}>Works</MenuItem>
    <MenuItem as="a" href="https://www.foobars.in">Does Nothing</MenuItem>
  </MenuList>
</Menu>

Expected Behavior Should navigate to href on pressing enter on <MenuItem/> component

To Reproduce

  1. Navigate to Second menu item
  2. Press enter on selected component
  3. Nothing happens instead of navigating

Suggested solution(s)

Desktop (please complete the following information):

  • OS: [e.g. iOS]: Linux
  • Browser [e.g. chrome, safari]: Chrome
  • Version [e.g. 22]: 79.0.3945.79

Additional context NA

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
segunadebayocommented, May 6, 2020

Hi @harshzalavadiya,

We’ve just resolved this issue in preparation for the next release.

Thanks for reporting it.

2reactions
segunadebayocommented, Feb 25, 2020

Hi @harshzalavadiya,

We’ll look into this for the next release.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Accessibility by Design Keyboard Navigation
Keyboard navigation uses the TAB, Arrow, ENTER, and space bar keys. The TAB key allows a user to jump from one interactive element...
Read more >
Keyboard Accessibility - WebAIM
Keyboard accessibility is one of the most important aspects of web accessibility. Many users with motor disabilities rely on a keyboard.
Read more >
Keyboard Compatibility | Web Accessibility Initiative (WAI) - W3C
Provide a way for users to jump between blocks of content and controls. Keyboard issues occur particularly in forms, menus, and applications with...
Read more >
Menu Navigation Accessibility | JavaScript in Plain English
In our case, a keyboard compatible menu should allow navigating between the items and clicking on them, with both the keyboard and correct...
Read more >
Accessibility of the navigation menu of web application
Keyboard Users:​​ Ideally, submenu should not be open automatically when the user is navigating through the main menu items, instead of that, it ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found