LearnNewsExamplesConnect
Frontmatter
assigneesneo-opus-ada
createdAtOct 20, 2026, 2:57 PM
updatedAtOct 20, 2026, 5:47 PM
githubUrlhttps://github.com/neomjs/neo/issues/19913
authorneo-opus-ada
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtOct 20, 2026, 5:47 PM

aria-sort: no browser e2e, and every idle header updates on each sort

Closed v13.3.0/archive-v13-3-0-chunk-2 enhancementaitestinggridaccessibility
neo-opus-ada
neo-opus-ada commented on Oct 20, 2026, 2:57 PM

Correction, 2026-10-20 ~13:05Z. The first version of this ticket called the comment in src/table/header/Button.mjs removeSortingCss() false. It is correct: writing back unchanged classes runs no afterSetCls() and no update. My probe started from headers whose isSorted: null had never run afterSetIsSorted(), so they were not hidden yet. The steady-state measurement below replaces it, and the defect is the opposite one.

Context

#19908 (merged 2026-10-20, resolves #19886) gives the grid and table header buttons aria-sort. I was reviewing it when it merged. Two findings from that review still hold on dev:

  1. Nothing in the suite reads aria-sort off a rendered header. HeaderButtonSortable.spec.mjs reads vdom. The DOM reads in the PR body were a manual probe. A grid change needs a browser e2e that fails on the base and passes with the fix; #19777 waited for one.
  2. Every idle header now updates on every sort. Both removeSortingCss() methods clear aria-sort and update unconditionally: the grid through changeVdomRootKey(), the table through an explicit me.update(). The container calls removeSortingCss() on every header except the sorted one. Before #19908, an already-hidden header wrote back the same classes and did not update.

The Problem

I measured the steady state with a unit probe. There are five headers. The first sort, on header 0, leaves headers 1–4 hidden. The second sort, on header 1, then runs removeSortingCss() on the other four, counting calls per header:

source update(): header 0 (loses its sort) update(): headers 2–4 (already hidden)
before #19908 (617684fb84) 1 0
dev with #19908 (9771bebcb8) 2 1 each

The grid and table counts are identical. In both sources afterSetCls runs once for header 0 and never for headers 2–4.

A sort on a grid with N columns used to update one header. It now updates N−1 headers, N−2 of which carry no aria-sort and render nothing new. I did not measure what the extra calls cost in the browser. This ticket claims only the call count.

The Architectural Reality

  • src/component/Base.mjs: changeVdomRootKey() always calls me.update(). afterSetCls() runs only when the classes change, because the generated setter skips afterSet when config.set() finds the value equal (src/Neo.mjs).
  • src/grid/Container.mjs and src/table/Container.mjs removeSortingCss(dataField) call the header's removeSortingCss() on every header except the sorted one, on every sort.
  • Only the header that loses its sort carries aria-sort. Its classes usually change too (neo-sort-hidden is added), but not for a sorted header that sortable: false hid afterwards. That is why the clear needs its own update when there is something to clear, and only then.
  • The grid's menu wrap (wrapColumnMenuRoot()) keeps the original root as cn[0], so getVdomRoot() stays the columnheader node.
  • E2E homes:
    • test/playwright/e2e/grid/IssuesShowcase.spec.mjs opens examples/grid/issues on a stubbed snapshot, with # sorted descending at start.
    • examples/table/container has no spec yet. The table specs live in test/playwright/e2e/table/.

The Fix

  1. src/grid/header/Button.mjs removeSortingCss(): call changeVdomRootKey('aria-sort', null) only when getVdomRoot() carries aria-sort.
  2. src/table/header/Button.mjs removeSortingCss(): delete and update() only when the <th> carries aria-sort, and keep the comment's reason.
  3. E2E: read aria-sort off the rendered headers, sort by clicking a header, then read again:
    • the grid: # and Title in IssuesShowcase.spec.mjs;
    • the table: Firstname and Lastname on examples/table/container.

Acceptance Criteria

  • AC-1: A grid e2e asserts that the sorted header carries aria-sort (descending at start, ascending after the click) and that the other headers carry none. It fails with both header files at 9771bebcb8^ and passes on dev.
  • AC-2: A table e2e does the same on examples/table/container.
  • AC-3: In the steady state, a sort updates no header that carries no aria-sort. A unit arm in HeaderButtonSortable.spec.mjs asserts this for both buttons. It fails at 9771bebcb8, and the spec stays green.

Out of Scope

  • afterSetIsSorted()'s own write. It touches one header per sort, which already updates for its class change.
  • Whether changeVdomRootKey() should skip update() when nothing changed. That is engine-wide.
  • Container#removeSortingCss() walking every header on every sort (it predates #19908).
  • How a real screen reader announces it (#19908's post-merge validation).

Related

#19908 · #19886 · #19777 (the grid e2e precedent)

Live latest-open sweep: latest 20 open neomjs/neo issues at 2026-10-20T12:56Z, plus gh search issues --owner neomjs "aria-sort" (only #19886, closed). No equivalent found. A2A sweep: last 30 messages, no claim on this scope. Maryam's #19908 approval (5585242412) names neither finding. MC sweep: "header removeSortingCss stale aria-sort class write-back produces no update changeVdomRootKey extra update per sort", 6 results, no prior decision found. Own-assignment sweep: 7 open, none overlapping.

Origin Session ID: cb31dca3-4e5a-4215-a0de-4798cd452ee3 Retrieval Hint: "aria-sort header removeSortingCss idle header update per sort steady state e2e"

tobiu closed this issue on Oct 20, 2026, 5:47 PM
tobiu referenced in commit 4083341 - "fix(grid): only a header carrying aria-sort clears and updates, witnessed in the browser (#19913) (#19914) on Oct 20, 2026, 5:47 PM