Skip to content

a11y(2.1.1): fake-button widgets — replace deprecated onkeypress with onkeydown handling Enter and Space#3528

Open
rosanusi wants to merge 1 commit into
mainfrom
wcag/2.1.1-fake-button-keypress-to-keydown
Open

a11y(2.1.1): fake-button widgets — replace deprecated onkeypress with onkeydown handling Enter and Space#3528
rosanusi wants to merge 1 commit into
mainfrom
wcag/2.1.1-fake-button-keypress-to-keydown

Conversation

@rosanusi

Copy link
Copy Markdown
Contributor

Description & motivation 💭

Three fake-button widgets (<div role="button"> / <g role="button">) used the deprecated onkeypress event to activate on keyboard input. Two problems:

  1. keypress is deprecated — unreliable for Space in Firefox; modern guidance is keydown with explicit key matching.
  2. No preventDefault() on Space — pressing Space activates the widget and scrolls the page (or scrollable SVG ancestor), causing a jarring jump before the action fires.

This PR replaces all three call sites with onkeydown handlers that match Enter and ' ' (Space), call preventDefault() to suppress scroll, and invoke the existing click handler. The mouse onclick/on:click paths are untouched.

Files changed (3):

  • src/lib/holocene/navigation/navigation-button.svelte — bottom-nav settings/namespace-picker/feedback buttons (finding #2b)
  • src/lib/components/lines-and-dots/svg/timeline-graph-row.svelte — interactive timeline-graph event row; closes matrix defect (c) (finding [Styling] Font Change #8)
  • src/lib/components/workflow/relationships/workflow-family-node-tree.svelte — two <g role="button"> family-tree nodes (finding Show workflows in UI #9)

SC: 2.1.1 Keyboard (Level A) — current verdict: Fails → Supports (for these three widgets)

Screenshots (if applicable) 📸

No visual change. Keyboard behaviour change only.

Design Considerations 🎨

None — no design tokens or layout affected.

Testing 🧪

How was this tested 👻

  • Manual testing

Steps for others to test: 🚶🏽‍♂️🚶🏽‍♀️

  1. navigation-button — Tab to the settings / namespace-picker / feedback button in the bottom nav. Press Enter: confirm activation. Press Space: confirm activation without page scroll.
  2. timeline-graph-row — Open a workflow with a timeline graph (xl viewport). Tab into the SVG and onto a graph row. Press Enter: confirm the active-group selection expands. Press Space: confirm activation without scrolling the graph container.
  3. workflow-family-node-tree — Open a workflow relationships view. Tab through family-tree nodes. Press Enter and Space on each: confirm node selection fires. Confirm Space does not scroll the ZoomSvg pan container.
  4. Mouse regression — click each widget with the mouse; confirm activation still works identically.
  5. Firefox — repeat steps 1–3 in Firefox, where keypress-on-Space was previously inconsistent. Both Enter and Space should now activate reliably.
  6. VoiceOver smoke test — focus each widget, confirm announcement is {name}, button; activate with VO+Space and Enter; both should fire.
  7. axe-core — run on workflow detail and family-tree relationships pages; zero new violations.

Checklists

Draft Checklist

  • Firefox cross-browser check for Space activation
  • VoiceOver smoke test on all three widgets

Merge Checklist

  • Tested in Firefox (Space previously unreliable via keypress)
  • axe-core: zero new violations
  • Mouse regression confirmed on all three widgets

Issue(s) closed

Closes findings #2b, #8, #9 from audit-output/issues/2.1.1-keyboard-audit.md.
Closes matrix defect (c) recorded at audit-output/vpat-matrix.md:119.

Docs

Any docs updates needed?

No doc changes needed.

A11y-Audit-Ref: 2.1.1-fake-button-keypress-to-keydown

…ton widgets

keypress is deprecated and does not reliably fire for Space in Firefox;
pressing Space also scrolled the page before activating the widget. Replace
all three call sites with onkeydown handlers that match Enter and ' ',
call preventDefault() to suppress page scroll, and invoke the existing
click handler. Closes matrix defect (c).

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@vercel

vercel Bot commented Jun 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
holocene Ready Ready Preview, Comment Jun 10, 2026 9:10pm

Request Review

@CLAassistant

CLAassistant commented Jun 10, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions Bot added a11y Accessibility audit PR a11y:bucket-3 Bucket 3: engineer required a11y:sc-2.1.1 labels Jun 10, 2026
@temporal-cicd

temporal-cicd Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor
Warnings
⚠️

📊 Strict Mode: 10 errors in 2 files (1.1% of 902 total)

src/lib/components/lines-and-dots/svg/timeline-graph-row.svelte (5)
  • L105:20: 'distance' is possibly 'null'.
  • L105:31: 'workflowDistance' is possibly 'null'.
  • L116:20: 'distance' is possibly 'null'.
  • L116:31: 'workflowDistance' is possibly 'null'.
  • L259:12: 'pendingActivity.attempt' is possibly 'null' or 'undefined'.
src/lib/components/workflow/relationships/workflow-family-node-tree.svelte (5)
  • L79:21: Parameter 'e' implicitly has an 'any' type.
  • L171:6: Type 'string | null' is not assignable to type 'string | number'.
  • L232:8: Type 'false | "[writing-mode:vertical-lr]"' is not assignable to type 'ClassValue | null | undefined'.
  • L239:25: 'child.siblingCount' is possibly 'undefined'.
  • L300:6: Type 'string | null' is not assignable to type 'string | number'.

Generated by 🚫 dangerJS against 622e0b4

@rosanusi rosanusi marked this pull request as ready for review June 11, 2026 15:15
@rosanusi rosanusi requested a review from a team as a code owner June 11, 2026 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a11y:bucket-3 Bucket 3: engineer required a11y:sc-2.1.1 a11y Accessibility audit PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants