Skip to content

Conversation

@domfarolino
Copy link
Member

@domfarolino domfarolino commented Dec 11, 2025

This PR introduces the <menubar>, <menulist>, and <menuitem> elements as they appear in Open UI's menu elements proposal: https://open-ui.org/components/menu.explainer/. This includes their integration with popovers, command invokers, <fieldset> and checkability, default styles, and variant default styles for the <menulist> element depending on how it is rendered. What has not been spec'd yet is:

  • Anchor positioning fallback styles
  • The orientation attribute's effect on default styles and keyboard navigability
  • Exact keyboard behavior; we plan to follow customizable select's precedent (see [select] keyboard behavior openui/open-ui#1087) of specifying activation behavior, and what happens when you keyboard-navigate away from a menu item (i.e., dismissing <menulist> popovers). But to be consistent with customizable select, we're not planning on specifying the exact keyboard behavior for getting from one menulist to another in a menubar, or traversing through menu items in a menu bar or list. These will be covered by examples, notes, and .optional WPTs
  • The checked event integration discussed in What event should fire on checkable menu items? openui/open-ui#1321
  • Figuring out how/if we need to express keyboard type-ahead search (i.e., pressing the a key to focus the first menuitem in a menulist that starts with the character a)
  • ...

This PR is only a draft. It's suitable for stage 2 evaluation of the menu elements proposal tracked by #11729, but has rough edges and non-trivial TODOs. The API shape is just about fully expressed though.

(See WHATWG Working Mode: Changes for more details.)


/dom.html ( diff )
/form-elements.html ( diff )
/grouping-content.html ( diff )
/index.html ( diff )
/indices.html ( diff )
/infrastructure.html ( diff )
/interaction.html ( diff )
/interactive-elements.html ( diff )
/obsolete.html ( diff )
/popover.html ( diff )
/rendering.html ( diff )
/semantics-other.html ( diff )

Note there are a couple open questions in the form of TODOs. For example:

1. Should `popovertargetaction` be allowed to target `<menulist>` elements?
   Probably, but it could use discussion.
2. Should the attribute change steps that react to `popover` attribute
   mutations "work" on `<menulist>` elements? This effectively makes the
   explicit `popover` attribute work on `<menulist>` elements, possibly
   overriding their default popover behavior. This could also use more
   discussion. (My preference would be to ignore `popover` on `<menulist>`
   for now).
This commit moves the command/commandfor attributes into their own section,
since they're general to both buttons and menuitem elements. The next steps are:

 1. Pull out a shared activation behavior algorithm from the button element,
 that defines the command-invoking parts that the two elements have in common
 2. Add the three new commands
 3. Define the menuitem element, and any menuitem-specific things for the
    commands
These are copied from the main button activation steps's popover handling steps
@domfarolino domfarolino added the agenda+ To be discussed at a triage meeting label Dec 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agenda+ To be discussed at a triage meeting

Development

Successfully merging this pull request may close these issues.

2 participants