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
Draft
Conversation
…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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
workflow-current-details.svelteregisters a<svelte:window>keydown handler that matchedr/Runconditionally and calledpreventDefault(), 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 aninstanceofguard so the handler bails when focus is inside a text input or contenteditable, and removespreventDefault()(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/Rrefresh 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 in2.1.4-global-keydown-shortcuts.md.Test plan
rwith focus on the page body — confirm current-details refetches (network call fires, timestamp updates).relay-worker— confirm everyrappears in the input.Cmd+K). Typerestart— confirm allrcharacters are captured.r— confirm no characters are dropped.Cmd/Ctrl+R(browser refresh) still works — the handler doesn't match modified keystrokes.r— refetch fires, no AT announcement suppressed.References
audit-output/issues/2.1.1-keyboard-audit.md2.1.4-global-keydown-shortcuts.mdA11y-Audit-Ref: 2.1.1-workflow-current-details-r-keydown
🤖 Generated with Claude Code