LearnNewsExamplesConnect
Frontmatter
assignees[]
createdAtNov 12, 2026, 5:30 PM
updatedAtNov 12, 2026, 9:31 PM
githubUrlhttps://github.com/neomjs/neo/issues/20829
authorneo-opus-vega
commentsCount2
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined2
signals[]
blockedBy[]
blocking[]
closedAtNov 12, 2026, 9:31 PM

A pressed Button never tells assistive technology it is pressed

Closed v14.0.0/archive-v14-0-0-chunk-1 bughelp wantedgood first issueaicoreaccessibility
neo-opus-vega
neo-opus-vega commented on Nov 12, 2026, 5:30 PM

Context

Neo.button.Base has a reactive pressed_ config (src/button/Base.mjs:124-128), and afterSetPressed (:384-389) toggles only the pressed CSS class. The engine's own grid search toolbar writes the attribute by hand next to set({pressed}) (src/grid/SearchToolbar.mjs:67, :262), and app code that wants an accessible toggle has to copy that.

  • Design authority: the WAI-ARIA Authoring Practices button pattern: a toggle button exposes its state through aria-pressed. pressed_ is documented as "The pressed state of the Button" with no semantics beyond the class.

The Problem

A screen reader announces a toggle button's state from aria-pressed. A Neo button with pressed: true reads as a plain button, and its state change is silent. Every consumer that wants the right semantics writes the attribute itself, in a second write next to the config, and can drift from pressed.

The Architectural Reality

  • pressed_ defaults to false, so afterSetPressed(false) runs for every button at construction. Today a plain button and a toggle that is off are the same state. Writing aria-pressed="false" on every button would announce plain buttons as toggles, so the attribute must stay off buttons that are not toggles.
  • toJSON() serializes pressed (:654).
  • Engine code that sets pressed: src/toolbar/Base.mjs, src/dashboard/dock/interaction/RevealOverlay.mjs, src/grid/SearchToolbar.mjs.
  • Tab headers are buttons too. Neo.tab.header.Button (role="tab") extends Neo.button.Base and calls super.afterSetPressed(), and Neo.tab.Container sets a Boolean pressed on every header (src/tab/Container.mjs:543, :904-906). A tab states its selection through aria-selected (test/playwright/unit/tab/Aria.spec.mjs); ARIA does not allow aria-pressed on role="tab".

The Fix

The button renders aria-pressed from pressed for toggle buttons only, in the same update that toggles the class. One shape: default pressed_ to null (not a toggle), and let afterSetPressed write aria-pressed for a Boolean and remove it for null. Check the existing pressed readers first (for example strict === false comparisons); if the default cannot move, an explicit toggle config is the alternative. Then SearchToolbar drops its manual writes. Tab headers keep aria-selected and render no aria-pressed.

Contract Ledger

Target Surface Source of Authority Proposed Behavior Fallback Docs Evidence
Neo.button.Base#pressed_ default WAI-ARIA APG button pattern null marks a plain button; a Boolean marks a toggle an explicit toggle config, if the default cannot move the config's JSDoc unit spec under test/playwright/unit/button/
Neo.button.Base#afterSetPressed same renders aria-pressed="true"/"false" for a Boolean and removes it for null, in the update that toggles the pressed class none method JSDoc same spec
Neo.tab.header.Button, Neo.tab.header.EffectButton (role="tab") WAI-ARIA APG tabs pattern, test/playwright/unit/tab/Aria.spec.mjs keep aria-selected (a Boolean on every tab); never render aria-pressed none none a tab arm in the spec
Toggle consumers that read pressed === false, e.g. the dock example's saved-perspective buttons test/playwright/unit/dashboard/DockZoneModel.spec.mjs declare pressed: false at creation, so they are toggles none none that spec stays green
Neo.grid.SearchToolbar case button this ticket no hand-written aria-pressed none none its existing specs

Acceptance Criteria

  • A button whose owner sets pressed: true or pressed: false renders aria-pressed="true" / "false" and keeps it in sync on every change, in the update that toggles the pressed class.
  • A button that never sets pressed renders no aria-pressed.
  • A tab header (role="tab") renders aria-selected and no aria-pressed.
  • src/grid/SearchToolbar.mjs writes no aria-pressed itself, and its case button still follows the filter.
  • A unit spec under test/playwright/unit/button/ covers the plain, pressed and unpressed states through the vdom.

Out of Scope

aria-expanded on menu buttons, the selection semantics of tab headers, toggle groups.

Avoided Traps

  • aria-pressed on every button: it announces plain buttons as toggles.
  • aria-pressed on tab headers: a tab's state is its selection.

Related

#20735 (the visual half: pressed background, text and glyph tokens) · #15324 (native disabled semantics on button.Base, the same class of gap).

Live latest-open + closed sweep: latest 20 open read (32 open, orange band; no owning accessibility epic) + closed search ("button pressed aria", "toggle button accessibility"; #15324's Out of Scope read) + A2A claims of the last hour + Memory Core + own assignments at 2026-11-12T16:30Z; no equivalent or prior exclusion found.

Edit 2026-11-12 19:2xZ (ticket author): added the tab-header row, AC and trap, and the Contract Ledger, after both open PRs showed tabs gaining aria-pressed. The tab invariant was implied by Out of Scope and is now stated.

unowned-rationale: Ready for a contributor; maintainers provide planning and review.

Origin Session ID: 2051845f-04a4-4248-a5b5-a633fd710e5a Retrieval Hint: "button pressed aria-pressed toggle semantics"

bfs2021 cross-referenced by PR #20833 on Nov 12, 2026, 7:03 PM
tobiu closed this issue on Nov 12, 2026, 9:31 PM