LearnNewsExamplesConnect
Frontmatter
assignees[]
createdAtOct 20, 2026, 12:03 PM
updatedAtOct 20, 2026, 4:58 PM
githubUrlhttps://github.com/neomjs/neo/issues/19886
authorneo-opus-ada
commentsCount4
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined1
signals[]
blockedBy[]
blocking[]
closedAtOct 20, 2026, 2:53 PM

Sorted grid and table headers do not announce their sort direction

Closed v13.3.0/archive-v13-3-0-chunk-2 bughelp wantedgood first issuehacktoberfestaigridaccessibility
neo-opus-ada
neo-opus-ada commented on Oct 20, 2026, 12:03 PM

Claim it first: comment on this issue before you start, and check the open pull requests for one that already points here. We merge the first approve-worthy PR (see CONTRIBUTING.md, point 3).

Context

Welcome! A small accessibility fix in Neo.mjs's grid and table headers. You need a fork, Node and the dev server; no Agent OS, Docker or AI tooling.

A column header is a <button role="columnheader">. When you sort a column, the header shows an arrow, but a screen reader is not told: nothing sets aria-sort, the attribute that announces "sorted ascending" or "sorted descending". A search for aria-sort in src/ finds nothing.

The Problem

To see it:

  1. npm install, then npm run server-start.
  2. Open http://localhost:8080/examples/grid/issues/index.html. The # column starts sorted.
  3. Inspect its header in DevTools: <button role="columnheader" … class="… neo-sort-desc …">, with a class for the arrow and no aria-sort.

The Architectural Reality

  • src/grid/header/Button.mjs afterSetIsSorted(value) turns the sort state into CSS classes: null adds neo-sort-hidden, 'ASC' sets neo-sort-asc, 'DESC' sets neo-sort-desc. It is the one place that already reacts to every sort change.
  • removeSortingCss() in the same file clears a header's sort by resetting _isSorted directly, so it bypasses afterSetIsSorted() and needs its own update.
  • src/table/header/Button.mjs has the same two methods.
  • test/playwright/unit/grid/HeaderButtonSortable.spec.mjs already drives both buttons; unit tests run locally.

The Fix

In both header buttons, set aria-sort alongside the classes: ascending for 'ASC', descending for 'DESC', and no aria-sort for an unsorted header (per WAI-ARIA, only the sorted header carries it). Clear it in removeSortingCss() as well. Add unit cases to HeaderButtonSortable.spec.mjs for both buttons.

Acceptance Criteria

  • AC-1 A grid header sorted ascending carries aria-sort="ascending", sorted descending aria-sort="descending", and an unsorted header carries none, including after removeSortingCss().
  • AC-2 The table header button behaves the same.
  • AC-3 npm run test-unit -- test/playwright/unit/grid/HeaderButtonSortable.spec.mjs passes and covers all three states for both buttons.

Out of Scope

  • The header menus' own option labels (#19878).
  • Announcing multi-column sort order.

Related

#18985 (this year's Hacktoberfest door) · found while testing the 13.3 issues showcase (#19756)

unowned-rationale: a good first issue for an outside contributor; a maintainer reviews the pull request.

Live latest-open sweep at 2026-10-20 ~10:08Z (latest 20 open) and gh search issues "aria-sort": no equivalent.

Origin Session ID: ad84dc14-8baf-4f95-a7dd-a9e224f51c31

tobiu closed this issue on Oct 20, 2026, 2:53 PM
tnalbant
tnalbant Oct 20, 2026, 4:55 PM

I'd like to claim this one.

Plan: set aria-sort alongside the existing sort classes in afterSetIsSorted() of both src/grid/header/Button.mjs and src/table/header/Button.mjs — ascending for 'ASC', descending for 'DESC', attribute removed for a header that is not sorted — and clear it in removeSortingCss() as well, since that path resets _isSorted directly and bypasses the setter. Unit coverage in test/playwright/unit/grid/HeaderButtonSortable.spec.mjs for all three states on both buttons, run with npm run test-unit -- test/playwright/unit/grid/HeaderButtonSortable.spec.mjs.

I checked the open pull requests for one that already points here and found none.

tnalbant
tnalbant Oct 20, 2026, 4:58 PM

@sunred-liu got here first (11:33Z, and the automation confirmed the reservation), so I'm standing down on this one — no branch, no PR from me. Good luck with the fix!