Skip to content

Keep focus in the Backup/Restore/Import dialogs when a run starts #798

Closed

Description

@EVWorth

Severity: P1 (keyboard users lose the dialog mid-run)

What happens

  1. Open ?mock=connected. Toolbar → Backup, pick database shop, Browse.
  2. Tab to the Backup button and press Enter.

Focus drops to <body>. Escape does nothing, and the next Tab lands on the "File" menu behind the dialog — the focus trap is gone while the dialog is still open. The same happens in Restore (the Restore button becomes disabled "Restoring...") and in Import (SQL mode: every control in the dialog is disabled during the run, so Escape does not close it either).

Cause

  • src/components/backup/BackupDialog.tsx:640-662 swaps the footer for a Cancel button, unmounting the focused button.
  • src/components/backup/RestoreDialog.tsx:425 and src/components/import/ImportDialog.tsx:735-752 disable the focused button.
  • src/components/common/Modal.tsx:121 handles Escape and Tab in the panel's onKeyDown, so once focus is on <body> neither fires.

Fix

When a run starts, move focus to the Cancel button (or the role="status" progress region with tabIndex=-1). In Modal, also listen for Escape/Tab on document while open, and pull focus back into the panel if it has escaped.

Part of #783.

Activity

  1. added
    bug
    on Oct 21, 2026
  2. added a commit that references this issue on Oct 23, 2026
    3af83df
  3. added a commit that references this issue on Oct 23, 2026
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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions