openui / openui/open-ui

[focusgroup] Feedback: Pointer-activated menu should not focus first item, but clicking down arrow after clicking the menu trigger should still activate the first item ( autofocus or tab-into should not be necessary)

Open
#1,407 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

focusgroup menu needs-triage
Dominant language
MDX
Stars
4.5k
Forks
226
Avg merge
2d 22h
Merged PRs (30d)
4

Description

Current demo

The current demo uses autofocus on the first item to make sure that the first item is accessible by arrow keys:

https://github.com/user-attachments/assets/c1835e8a-8215-46a8-be5d-006a64b2369b

However, it is unexpected behavior that the first item is focused after clicking the trigger.

Expected

The first item should not be autofocused after opening the menu

w3.org/WAI/ARIA:

https://github.com/user-attachments/assets/81acc7a5-0ce7-44f8-9587-36de78c4105e

Mac os:

https://github.com/user-attachments/assets/15aec4a4-f393-45a4-9e2c-4a6a0695afa3

What happens if you remove the 'autofocus' attribute on the first item?

Then the arrow keys are not immediately working to get into the menu: Then you first need to tab-into the menu. This is also unexpected ref. WAI/ARIA and Mac os.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the current focusgroup menu demo linked in the issue and compare its pointer and keyboard behavior with the WAI-ARIA and macOS references. The work is done when opening the menu by pointer does not focus the first item, while clicking the down arrow immediately activates or enters that item without autofocus or a prior tab-into step.

Written by the indexing model from the issue text.

Assessment

Tech stack
html
Domain
accessibility, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.