Skip to content

Keyboard accessibility and ARIA for column cog menu - #2873

Open
opensource-joe wants to merge 1 commit into
simonw:mainfrom
opensource-joe:fix/1964-cog-menu-keyboard-a11y
Open

Keyboard accessibility and ARIA for column cog menu#2873
opensource-joe wants to merge 1 commit into
simonw:mainfrom
opensource-joe:fix/1964-cog-menu-keyboard-a11y

Conversation

@opensource-joe

Copy link
Copy Markdown

Refs #1964

The column actions (cog) menu is currently mouse-only. The trigger is a bare SVG with a click handler — it isn't in the tab order — and the menu has no ARIA roles or keyboard navigation.

This adds keyboard support following the ARIA menu button pattern:

  • The cog trigger becomes a focusable role="button" with aria-haspopup="menu", aria-expanded, and an aria-label ("Column actions for {column}"). It opens with Enter / Space / ArrowDown.
  • The menu gets role="menu" and each item role="menuitem" with roving tabindex; Up/Down/Home/End move focus (wrapping).
  • Escape closes and returns focus to the trigger; Tab closes the menu.

Mouse behavior is unchanged. Diff is limited to datasette/static/table.js (+71/-2).

Note: I wasn't able to run the full Playwright suite headless in my environment, so a maintainer check in a browser would be welcome — happy to add a Playwright test for the keyboard flow if you'd like.

The column actions (cog) menu was mouse-only: the trigger had no keyboard
affordance and the menu had no ARIA roles or arrow-key navigation.

- Make the cog trigger a focusable role="button" with aria-haspopup="menu",
  aria-expanded, and an aria-label; open it with Enter/Space/ArrowDown.
- Add role="menu"/role="menuitem" and roving focus with Up/Down/Home/End.
- Escape closes and restores focus to the trigger; Tab closes the menu.

Refs simonw#1964

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@opensource-joe
opensource-joe force-pushed the fix/1964-cog-menu-keyboard-a11y branch from 8e8e9b4 to 6289ecf Compare August 13, 2026 13:33
@opensource-joe

Copy link
Copy Markdown
Author

@simonw Would you be able to approve the workflow runs on this PR?

As a first-time contributor here my workflows need a maintainer to release them, so all six runs are sitting at action_required and none have executed since the PR was opened on 8 August. It is easy to miss because the PR reads as green at a glance: docs/readthedocs.org reports and passes, so the checks list looks healthy while the actual test suite has never run.

Not asking for a review yet, just for CI to be allowed to run so anything it catches is mine to fix first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant