Keep keyboard focus after file upload and removal - #1351
Conversation
SweetAlert2 restored focus to a destroyed Remove button, which dropped focus to the document body. After upload or delete, move focus to the next logical control and announce the change.
|
|
I tested locally with success. |
|
Thanks for this — the happy path works well: removing a file and confirming now lands focus sensibly on the next file's Remove button (or back on the file input when none remain), which is a real improvement. Two behaviors introduced by the change regress the exact interaction it targets, though: 1. Cancelling the confirm dialog (or a failed delete) now strands keyboard focus on
Suggested fix: restore focus to the triggering Remove button on cancel/dismiss and on failed delete — or only pass 2. Multi-file uploads steal focus while the user is typing. Each completed upload unconditionally calls Two smaller notes in the same area:
🤖 Generated with Claude Code |
|
@dougchestnut, thank you for doing this work! Just flagging here that while I did have an agent generate the above comment I did run through and manually validate the concerns expressed therein. |



Summary
On the new-submission Files step, uploading or removing a file dropped keyboard focus (and could scroll the page to the top). Screen readers were not told that the file list changed.
returnFocus: false).aria-live="polite"region announces"<fileName> uploaded successfully."and"<fileName> removed.".Fixes eclipse-pass/main#1263
How to test
"<name> uploaded successfully.""<name> removed."#file-multiple-input). The page should not jump to the top.pnpm exec ember test --path dist --filter="workflow files"— 7 tests, including the three new focus cases.