LearnNewsExamplesConnect
Frontmatter
assigneesneo-opus-ada
createdAtOct 23, 2026, 3:41 PM
updatedAtOct 23, 2026, 4:17 PM
githubUrlhttps://github.com/neomjs/neo/issues/20058
authorneo-opus-ada
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtOct 23, 2026, 4:17 PM
milestonev13.3.1

A grid value menu's Clear drops focus to the page, so Escape no longer closes it

Closed v13.3.1/archive-v13-3-1-chunk-1 bugaigridaccessibility
neo-opus-ada
neo-opus-ada commented on Oct 23, 2026, 3:41 PM

Context

Found while stress-testing the grid shard for #19515, on dev d0f92ff6a6. grid/IssuesShowcase.spec "a filtered locked column keeps its header marked while its menu is closed (#19793)" failed 2 of 3 runs with the whole engine grid shard on 10 workers, and 1 of 20 run alone on 10 workers. Every failure was at the same line: after the menu's Clear and an Escape, .neo-grid-column-menu stayed visible for the full 5 s.

A probe made it deterministic. It is the same steps on examples/grid/issues, but it waits until the Clear button has left the DOM before pressing Escape, as a human's pause does. It failed 3/3 without load:

moment document.activeElement menu
right after the Clear click BUTTON#neo-button-9 (the Clear button) open
after the Clear button left the DOM BODY open
after Escape BODY still open (5 s)

The spec only passes when Playwright's Escape outruns the button's removal.

The Problem

Clearing the column's value filter hides the Clear button, which has nothing left to clear. The button is focused when it hides, so focus falls to the page:

  • Escape no longer reaches the menu.
  • A keyboard user who tabbed to Clear and pressed Enter loses their place.

The menu stays open until a click outside it.

The Architectural Reality

  • src/grid/header/plugin/Menu.mjs:
    • onClearClick calls onSelectionChange({selection: []}), and refreshOptions() then runs clear.hidden = !selected.length; clear.update().
    • The surface's Escape handling needs focus inside the surface.
    • open() puts focus on the search field: Neo.main.DomAccess.focus({id: surface.getItem('search').getInputElId(), unlessFocusWithin: surface.id, …}).
  • clear.hidden = true plus clear.update() is also the producer #20043 found (a component whose own flight renders it away). That ticket's fix keeps the flags paired; it does not move focus.

The Fix

When a Clear click empties the selection, onClearClick moves focus to the search field before the button hides, the target open() uses. A red-first arm in IssuesShowcase.spec covers this: open the State menu, pick a value, Clear, wait for the Clear button to leave, then press Escape.

Acceptance Criteria

  • AC-1: after Clear, with the Clear button gone, focus sits inside the menu (on its search field) and Escape closes the menu. The arm is red on d0f92ff6a6 and green at head.
  • AC-2: the existing IssuesShowcase.spec arms stay green, and the #19793 arm passes 20/20 alone on 10 workers.

Out of Scope

  • A generic focus-on-removal rule for any focused component that hides itself. Worth a separate look; the menu case is the user-visible one.
  • #20043's lifecycle pairing.

Related

#19515 (where this surfaced) · #19793 / #19805 (the arm) · #19711 (the value menu) · #19961 / #19962 (this menu's earlier focus fix) · #20043 / #20044 (the same hidden + update() producer) · Grace's 2026-09-18 menu probes (a hidden level that holds focus leaves Escape inert, the same class in Neo.menu).

Live latest-open sweep: checked the latest 20 open issues at 13:40Z; no equivalent. gh search issues "column menu Clear focus Escape" and "value menu focus lost": none. A2A in-flight claim sweep: the latest messages carry no claim on this scope (#20056 and #20057 are other surfaces). Memory Core rationale sweep: no prior decision; the nearest is Grace's 09-18 menu focus-loss class (D2, Neo.menu). Own-assignment sweep: none of my open tickets touches the value menu.

Origin Session ID: 577c5310-3173-4991-85a7-50aeabd66ceb

Handoff Retrieval Hints: "grid value menu Clear hides focused button focus falls to body Escape does not close menu"

⚖️ Ada · @neo-opus-ada · Claude Opus 5.5 · Claude Code

tobiu referenced in commit dfc5599 - "fix(grid): a value menu's Clear hands focus to its search field before it hides (#20058) (#20060) on Oct 23, 2026, 4:17 PM
tobiu closed this issue on Oct 23, 2026, 4:17 PM