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.

[a11y] Not keyboard accessible for components inside `MenuItem`

See original GitHub issue

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Steps to reproduce 🕹

Link to live example: https://codesandbox.io/s/beautiful-voice-bfgjc9

Steps:

  1. Tab into menu and hit the “Enter” button
  2. Hit the “down arrow” button until you arrive at the slider/switch
  3. Hit “Enter”/“Space” button(s) to focus on slider/switch

Current behavior 😯

The slider/switch will not focus, preventing users from manipulating the input with their keyboard.

Expected behavior 🤔

The slider/switch should focus, allowing users to manipulate the input with their keyboard.

Context 🔦

Allow our keyboard users to manipulate menu input.

Your environment 🌎

npx @mui/envinfo
   System:
    OS: macOS 12.6.1
  Binaries:
    Node: 14.18.3 - ~/.nvm/versions/node/v14.18.3/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v14.18.3/bin/yarn
    npm: 8.1.2 - ~/Projects/vt-llp-ui/node_modules/.bin/npm
  Browsers:
    Chrome: 107.0.5304.121 <= current browser
    Edge: Not Found
    Firefox: 107.0
    Safari: 16.1
  npmPackages:
    @emotion/react: 11.10.0 => 11.10.0 
    @emotion/styled: 11.10.0 => 11.10.0 
    @mui/base:  5.0.0-alpha.94 
    @mui/core-downloads-tracker:  5.10.13 
    @mui/material: 5.10.2 => 5.10.2 
    @mui/private-theming:  5.10.9 
    @mui/styled-engine:  5.10.8 
    @mui/system:  5.10.13 
    @mui/types:  7.2.0 
    @mui/utils:  5.10.9 
    @types/react: 17.0.38 => 17.0.38 
    react: 17.0.2 => 17.0.2 
    react-dom: 17.0.2 => 17.0.2 
    typescript: 4.6.4 => 4.6.4 

Issue Analytics

  • State:open
  • Created 10 months ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
sai6855commented, Dec 7, 2022

@ber8749

    <MenuItem onFocus={() => ref.current.focus()}>
          <Slider slotProps={{ input: { ref } }} aria-label="Volume" />
        </MenuItem>
0reactions
xurxecommented, Dec 12, 2022

Relevant discussion on the W3C github:

Read more comments on GitHub >

github_iconTop Results From Across the Web

Building Accessible Menu Systems - Smashing Magazine
The menu and menuitem roles #​​ The short answer is: no. The long answer is: no, because our list items contain links and...
Read more >
Menus Tutorial | Web Accessibility Initiative (WAI) - W3C
Screen reader and keyboard users benefit from keyboard interoperability and markup that allows them to operate menus in different ways.
Read more >
Building an accessible menubar component using React
I have a real interest in accessibility, particularly in frontend web ... store a Set of nested MenuItem nodes within a parent Menubar...
Read more >
Keyboard accessibility: if menu can be operated with ...
A primary keyboard navigation convention common across all platforms is that the tab and shift+tab keys move focus from one UI component to ......
Read more >
Accessibility issues when using Material-UI 'Menu' on top of a ...
By default, the drawer enforces (so long as it is open) that focus stays within itself. So when the menu opens and grabs...
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