Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return key triggers focused item click in modal with primary action #2173

Open
iLynxcat opened this issue Mar 6, 2024 · 0 comments
Open
Labels
kind/bug Something isn't working status/needs-triage

Comments

@iLynxcat
Copy link
Contributor

iLynxcat commented Mar 6, 2024

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.

@iLynxcat iLynxcat added kind/bug Something isn't working status/needs-triage labels Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working status/needs-triage
Projects
None yet
Development

No branches or pull requests

1 participant