Skip to content

[menu] Activation behavior for opening submenus #1190

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
josepharhar opened this issue Apr 10, 2025 · 3 comments
Open

[menu] Activation behavior for opening submenus #1190

josepharhar opened this issue Apr 10, 2025 · 3 comments
Labels
interest-invokers menu Menu elements proposal

Comments

@josepharhar
Copy link
Collaborator

josepharhar commented Apr 10, 2025

If a menuitem is hooked up to open a submenu:

  1. Should hovering or clicking invoke the submenu? Should it be developer controllable?
  2. Should keyboard focus open the submenu, or should you have to focus and then press another keyboard button to open the submenu?
  • Where should keyboard focus go when the submenu is invoked?

Does interesttarget already have answers to all of these questions? If so, how could we ergonomically combine interesttarget with however we hook up the association between a menuitem and submenu?

@josepharhar josepharhar added interest-invokers menu Menu elements proposal labels Apr 10, 2025
@lukewarlow
Copy link
Collaborator

Right now this seems to be very much "it depends". There's not a clear consensus across the implementations I've seen.

Selfishly I think the macOS approach is good, because it's what I know. It might also marginally make it easier to spec. Though possibly like with select we can make this UA defined (I would prefer to specify though).

@lukewarlow
Copy link
Collaborator

I guess for an initial draft. We could just verbatim go with https://www.w3.org/WAI/ARIA/apg/patterns/menubar/ and then we can discuss specific changes to that where desired?

@scottaohara
Copy link
Collaborator

Should hovering or clicking invoke the submenu? Should it be developer controllable?

probably developer controllable. the menuitems of menubars commonly require specific action for a user to invoke them - but menuitems that invoke submenus within a menu popup and often automatically show their related submenus on hover/focus or still require someone to invoke them via purposeful activation (click even).

so mabye click to open is the default, and then authors can change to open on hover/focus to match their current custom implementations.

Should keyboard focus open the submenu, or should you have to focus and then press another keyboard button to open the submenu?

answered this above. it could be either.

Where should keyboard focus go when the submenu is invoked?

if opened via click, then auto-moving to the appropriate menuitem in the submenu can be reasonable.
but would not be desired if the submenu auto opened on focus/hover

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interest-invokers menu Menu elements proposal
Projects
None yet
Development

No branches or pull requests

3 participants