Skip to content

Menu on web: the items are menuitems with no menu around them, and aria-modal sits on an element with no role #5349

Backlog

Description

@Doberjohn

Current behaviour

With a Menu open on the web, axe-core reports two critical violations:

  • aria-required-parent ("Required ARIA parents role not present: menu, menubar, group") on each <div role="menuitem">.
  • aria-allowed-attr ("ARIA attribute is not allowed: aria-modal="true"") on the menu's content <div>.

So assistive technology gets the items with no menu around them: no menu name and no item count.

Expected behaviour

The menu's content has role="menu", named by its anchor, around the items, as FAB.Menu does on the web since #5170, and no aria-modal without a dialog role.

How to reproduce?

  1. Render:
<Menu
  visible={visible}
  onDismiss={() => setVisible(false)}
  anchor={<Button onPress={() => setVisible(true)}>Menu</Button>}
>
  <Menu.Item title="Undo" onPress={() => setVisible(false)} />
  <Menu.Item title="Redo" onPress={() => setVisible(false)} />
</Menu>
  1. Export for the web, open the menu and run axe-core 4.10.3.

Preview

n/a

What have you tried so far?

6.0.0-alpha.4 renders the same. #5073 (the Menu rewrite) may be where this is fixed; #5215 is the native screen reader side.

Your Environment

software version
ios n/a
android n/a
react-native 0.88.1, react-native-web 0.21.4
react-native-paper 6.0.0-alpha.5 (main at fa8fc92)
node n/a; Chrome 158
npm or yarn n/a
expo sdk 58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions