Skip to content

a11y(2.1.1): workflow-current-details — guard global r/R keydown so text inputs can receive the letter#3589

Draft
rosanusi wants to merge 1 commit into
mainfrom
wcag/2.1.1-workflow-current-details-r-keydown
Draft

a11y(2.1.1): workflow-current-details — guard global r/R keydown so text inputs can receive the letter#3589
rosanusi wants to merge 1 commit into
mainfrom
wcag/2.1.1-workflow-current-details-r-keydown

Conversation

@rosanusi

Copy link
Copy Markdown
Contributor

Summary

workflow-current-details.svelte registers a <svelte:window> keydown handler that matched r/R unconditionally and called preventDefault(), silently swallowing the character from every text input on the workflow detail page — search box, command palette, filter inputs, activity-options drawer text fields. This PR adds an instanceof guard so the handler bails when focus is inside a text input or contenteditable, and removes preventDefault() (the refetch action has no default to suppress).

One-line diff:

 const handleKeydown = (event: KeyboardEvent) => {
+  const { target } = event;
+  if (
+    target instanceof HTMLInputElement ||
+    target instanceof HTMLTextAreaElement ||
+    (target instanceof HTMLElement && target.isContentEditable)
+  ) {
+    return;
+  }
   if (event.key === 'r' || event.key === 'R') {
-    event.preventDefault();
     fetchCurrentDetails();
   }
 };

The r/R refresh shortcut continues to fire when focus is on any non-input element. Long-term migration to a modifier-prefixed or focus-scoped shortcut is tracked separately in 2.1.4-global-keydown-shortcuts.md.

Test plan

  • Open a workflow detail page. Press r with focus on the page body — confirm current-details refetches (network call fires, timestamp updates).
  • Click into the workflow search box. Type relay-worker — confirm every r appears in the input.
  • Open the command palette (Cmd+K). Type restart — confirm all r characters are captured.
  • Open an activity-options drawer with a text field. Type a word containing r — confirm no characters are dropped.
  • Confirm Cmd/Ctrl+R (browser refresh) still works — the handler doesn't match modified keystrokes.
  • Screen reader smoke test (VoiceOver): navigate to the detail panel, press r — refetch fires, no AT announcement suppressed.

References

A11y-Audit-Ref: 2.1.1-workflow-current-details-r-keydown

🤖 Generated with Claude Code

…letter

The svelte:window keydown handler matched r/R and called preventDefault()
unconditionally, silently swallowing the character in every text input on
the workflow detail page (search box, command palette, filter inputs,
activity-options drawer).

Added an instanceof guard that bails when focus is inside an input,
textarea, or contenteditable. Removed preventDefault() — refetching
current details has no default to suppress, and its removal is what
restores typing.

The r/R refresh shortcut continues to fire when focus is on a non-input
element. Long-term migration to a modifier-prefixed or focus-scoped
shortcut is tracked in 2.1.4-global-keydown-shortcuts.md.

A11y-Audit-Ref: 2.1.1-workflow-current-details-r-keydown

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 23, 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 23, 2026 3:09pm

Request Review

@github-actions github-actions Bot added a11y Accessibility audit PR a11y:bucket-3 Bucket 3: engineer required a11y:sc-2.1.1 labels Jun 23, 2026
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.

1 participant