spacedriveapp / spacedrive

Spacedrive is an open source cross-platform file explorer, powered by a virtual distributed filesystem written in Rust.

Home Page:https://spacedrive.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Return key triggers focused item click in modal with primary action

iLynxcat opened this issue · comments

commented

Describe the bug

Background

By default, at least on macOS, the return key triggers the primary action on an active modal.

macOS username & password prompt with a highlighted "Modify Settings" button and a secondary, focused "Cancel" action.

In this example where Keyboard Navigation is enabled in System Settings — despite "Cancel" being focused, pressing return will press "Modify Settings" and submit the login form.

In Spacedrive, an open and focused modal will trigger the focused button when return is pressed even if a primary action is present.

Reproduction

  1. Begin with a fresh Spacedrive library.
  2. Navigate to Settings (,).
  3. Navigate to Library → Tags.
  4. Select a tag. (For instance, Memes).
  5. Press the Delete button.
  6. When the confirmation popup activates, first make note that "Cancel" is focused by default, and the primary action is "Delete."
  7. Press the return key.

After sending return, the focused action (Cancel) was triggered and the tag was not deleted.

Expected behavior

After sending the return keystroke, the primary action (Delete) should have triggered and deleted the tag.

Platform and versions

macOS: 14.3.1 (Sonoma, 23D60)

Spacedrive: v0.2.5 (55d2ec7)

Stack trace

No response

Additional context

In most cases,    space    is the key used to trigger the focused button rather than return/enter.