Skip to content

[Bug] Focus Trap Breaks After Deleting Project from Disk #270

@illia1f

Description

@illia1f

Description

After deleting a project from disk in the Recycle Bin dialog, all inputs become unfocusable. Focus can only be restored by triggering a system event (e.g., screenshot shortcut).

Reproduction

  1. Open Recycle Bin dialog
  2. Click "Delete from disk" on any project
  3. Confirm in the native browser dialog
  4. Try to focus any input - nothing works

Root Cause

window.confirm() is called inside the Radix UI Dialog at use-trash-operations.ts:33:

const confirmed = window.confirm(
  `Delete "${trashedProject.name}" from disk?\nThis sends the folder to your system Trash.`
);

The native browser dialog interrupts Radix UI's focus trap, leaving it in a corrupted state. When the native dialog closes, Radix's focus management is broken.

Proposed Solution

Replace window.confirm() with a React-based confirmation dialog (e.g., Radix UI Alert Dialog) to maintain consistent focus trap behavior.

Environment

  • OS: Windows
  • Electron
  • Dialog: Radix UI Dialog

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions