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:
- 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.
- 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
src/grid/header/Button.mjs removeSortingCss(): call changeVdomRootKey('aria-sort', null) only when getVdomRoot() carries aria-sort.
src/table/header/Button.mjs removeSortingCss(): delete and update() only when the <th> carries aria-sort, and keep the comment's reason.
- 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
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"
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 ondev:aria-sortoff a rendered header.HeaderButtonSortable.spec.mjsreads 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.removeSortingCss()methods cleararia-sortand update unconditionally: the grid throughchangeVdomRootKey(), the table through an explicitme.update(). The container callsremoveSortingCss()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:update(): header 0 (loses its sort)update(): headers 2–4 (already hidden)617684fb84)devwith #19908 (9771bebcb8)The grid and table counts are identical. In both sources
afterSetClsruns 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-sortand 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 callsme.update().afterSetCls()runs only when the classes change, because the generated setter skipsafterSetwhenconfig.set()finds the value equal (src/Neo.mjs).src/grid/Container.mjsandsrc/table/Container.mjsremoveSortingCss(dataField)call the header'sremoveSortingCss()on every header except the sorted one, on every sort.aria-sort. Its classes usually change too (neo-sort-hiddenis added), but not for a sorted header thatsortable: falsehid afterwards. That is why the clear needs its own update when there is something to clear, and only then.wrapColumnMenuRoot()) keeps the original root ascn[0], sogetVdomRoot()stays the columnheader node.test/playwright/e2e/grid/IssuesShowcase.spec.mjsopensexamples/grid/issueson a stubbed snapshot, with#sorted descending at start.examples/table/containerhas no spec yet. The table specs live intest/playwright/e2e/table/.The Fix
src/grid/header/Button.mjsremoveSortingCss(): callchangeVdomRootKey('aria-sort', null)only whengetVdomRoot()carriesaria-sort.src/table/header/Button.mjsremoveSortingCss(): delete andupdate()only when the<th>carriesaria-sort, and keep the comment's reason.aria-sortoff the rendered headers, sort by clicking a header, then read again:#and Title inIssuesShowcase.spec.mjs;examples/table/container.Acceptance Criteria
aria-sort(descendingat start,ascendingafter the click) and that the other headers carry none. It fails with both header files at9771bebcb8^and passes ondev.examples/table/container.aria-sort. A unit arm inHeaderButtonSortable.spec.mjsasserts this for both buttons. It fails at9771bebcb8, 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.changeVdomRootKey()should skipupdate()when nothing changed. That is engine-wide.Container#removeSortingCss()walking every header on every sort (it predates #19908).Related
#19908 · #19886 · #19777 (the grid e2e precedent)
Live latest-open sweep: latest 20 open
neomjs/neoissues at 2026-10-20T12:56Z, plusgh 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"