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

feat(FR-37): Add safety keyboard shortcut to close modal #2907

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yomybaby
Copy link
Member

@yomybaby yomybaby commented Dec 2, 2024

Resolve #2899

Changes:

  • Enhanced BAIModal keyboard handling to properly handle Escape key events
  • Added focus management to FolderCreateModal, automatically focusing the first input field when opened
  • Implemented controlled state management for modal open/close behavior
  • Added blur handling for form inputs before modal close when Escape is pressed

Rationale:
This improves the user experience by providing better keyboard navigation and accessibility. When users press Escape while focused on form inputs, it will first blur the input. A second Escape press will close the modal. The first input field is now automatically focused when the modal opens, reducing the need for manual mouse interaction.

Testing Requirements:

  1. Verify Escape key behavior:
    • First press should blur focused inputs
    • Second press should close modal
  2. Confirm first input field receives focus when modal opens
  3. Test keyboard navigation through form fields

Copy link

graphite-app bot commented Dec 2, 2024

Your org requires the Graphite merge queue for merging into main

Add the label “flow:merge-queue” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “flow:hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

@github-actions github-actions bot added the size:M 30~100 LoC label Dec 2, 2024
Copy link
Member Author

yomybaby commented Dec 2, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

@yomybaby yomybaby changed the title feat: Add safety keyboard shortcut to close modal [FR-37] feat: Add safety keyboard shortcut to close modal Jan 6, 2025
@yomybaby yomybaby changed the title [FR-37] feat: Add safety keyboard shortcut to close modal feat(FR-37): Add safety keyboard shortcut to close modal Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:M 30~100 LoC
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve keyboard shortcut handling for modals with forms
1 participant