Skip to content

Keep keyboard focus after uploading or removing files in the submission wizard #1263

Description

@dougchestnut

Description

On the new-submission Files step, keyboard focus is lost after a file is uploaded or removed. Screen reader users are not told that the file list changed.

This is a keyboard / WCAG 2.4.3 (Focus Order) and 4.1.3 (Status Messages) problem in workflow-files.

What is wrong today

  • After an upload, focus does not move to the new file. Keyboard users have to find the new row themselves.
  • After Remove, SweetAlert2 restores focus to the button that was just destroyed (returnFocus defaults to true). Focus falls back to <body> and the page can jump to the top.
  • There is no status announcement when a file is added or removed.

Expected

  • After upload, focus moves to that file’s Description field.
  • After Remove, if other files remain, focus moves to an adjacent file’s Remove button. If it was the last file, focus moves to the file picker (#file-multiple-input).
  • SweetAlert2 does not try to restore focus to the deleted button (returnFocus: false).
  • A visually hidden aria-live="polite" region announces "<fileName> uploaded successfully." and "<fileName> removed.".

Steps to reproduce

  1. Start a new submission and go to the Files step.
  2. Upload a file from the keyboard (or the file picker). Focus is not on the new Description field.
  3. Tab to Remove, confirm the SweetAlert. Focus is on the document body (often the page scrolls to the top) instead of the remaining file or the file picker.

Environment

pass-ui, new-submission wizard, Files step (app/components/workflow-files).

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions