Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

[RFC] Submenu functionality in Menu component #542

@jurokapsiar

Description

@jurokapsiar

Feature Request

Problem description

Menu should allow defining submenus. Each menu item can have a submenu.
Submenu should follow ARIA specification and best practices:
https://www.w3.org/TR/wai-aria-practices/#menu
https://www.w3.org/TR/wai-aria-practices/examples/menubar/menubar-1/menubar-1.html

especially with regards to the rendered DOM strucutre and keyboard navigation:

  • Submenu should be rendered as <ul> inside of the MenuItem wrapper slot. Menu items of that submenu should render normally as <li> items.
  • Submenu is always vertical
  • Home and End keys should not be used as the menu implements circular navigation.

As opposed to the specification described in the links above, submenu should not open when the user hovers on the menu item with a submenu. It should open when the user clicks on such a menu item or if he uses keyboard navigation keys for subemnu open.

API Proposal

  • add menu prop to the MenuItem component. User can pass a Menu shorthand to it.

MVP

There has already been two PRs implementing this. Both had good and bad sides and the good parts were merged into #539.

Metadata

Metadata

Assignees

No one assigned

    Labels

    vstsPaired with ticket in vsts⚙️ enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions