LearnNewsExamplesServices
Frontmatter
id18803
titleArrow keys right after a button menu opens have no witness
stateClosed
labels
enhancementaitesting
assigneesneo-opus-ada
createdAtSep 16, 2026, 3:50 PM
updatedAtSep 16, 2026, 8:08 PM
githubUrlhttps://github.com/neomjs/neo/issues/18803
authorneo-opus-ada
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtSep 16, 2026, 8:08 PM

Arrow keys right after a button menu opens have no witness

Closed v13.2.0/archive-v13-2-0-chunk-21 enhancementaitesting
neo-opus-ada
neo-opus-ada commented on Sep 16, 2026, 3:50 PM

Context

#6033 (open since 2024-10) reports that after opening the menu in examples/button/base, arrow keys no longer navigate right away, and suspects a missing focus() call. It is fixed on dev. A real-Chromium probe of that example at 5d375d9722:

opened by focus right after opening ArrowDown ArrowDown
click Item 1 (LI in .neo-menu-list) Item 2 Item 3 (a parent; its submenu previews)
Enter on the focused button Item 1 Item 2 Item 3
Space on the focused button Item 1 Item 2 Item 3
CONTROL: no menu opened BODY, no menu nothing moves

No committed test asserts it, so #6033 cannot close on evidence that stays true.

The Problem

What makes it work today is one line far from the button: component.Base#afterSetMounted focuses a floating component when it mounts, unless focusOnMount is false. #18765 added that flag so a hover preview does not steal focus. A later change that narrows the default or the floating branch would break #6033 again, and nothing would notice. The closest arm, component/menu/SpawnAnimation.spec.mjs › arrow-key navigation works during the entrance window, focuses the first item itself before pressing a key, so it passes whether or not opening the menu hands focus over.

The Architectural Reality

  • src/button/Base.mjs#toggleMenu() shows the floating menuList created with parentComponent: me.
  • src/component/Base.mjs:775 runs me.focusOnMount && me.focus(me.id, true) for a floating component on mount, and focus lands on the first item.
  • The Navigator moves the active item on ArrowDown once focus is inside the list.
  • test/playwright/component/button/Base.spec.mjs has no menu arm.

The Fix

Arms in test/playwright/component/button/Base.spec.mjs, on a Button with a three-item menu created in the component harness. Open the menu by click, by Enter and by Space on the focused button, then press ArrowDown without any explicit focus call. Assert that focus moved from the first item to the second.

Acceptance Criteria

  • AC-1 — the arms pass for click, Enter and Space on dev.
  • AC-2 — they fail when the opened menu does not take focus on mount (mutation receipt in the PR), so they witness the hand-off rather than the Navigator.
  • AC-3 — #6033 carries the probe receipt and a pointer to the arms (post-merge: closed as completed).

Out of Scope

  • Any change to focus, menu or Navigator behaviour.

Related

#6033 · #18765 (focusOnMount) · #5123 (the Navigator change #6033 suspected)

Live latest-open sweep: checked the latest 20 open issues at 2026-09-16T13:50:12Z; no equivalent. A2A claim sweep: latest 30 inbox messages, all read states; no claim on button menu focus. Memory Core rationale sweep: query_raw_memories on the symptom; hits are today's menu keynav lanes (#18758–#18760), no decision on this witness. Own-assignment sweep: 6 open, none on button menus. Structure-map gate: N/A.

Decision Record impact: none.

Origin Session ID: 0f5a0db0-9f3a-402c-bb4a-aa369ff1efa3

tobiu referenced in commit cf7aa3d - "test(button): a menu opened by click, Enter or Space takes focus, so arrow keys move right away (#18803) (#18804) on Sep 16, 2026, 8:08 PM
tobiu closed this issue on Sep 16, 2026, 8:08 PM