-
Notifications
You must be signed in to change notification settings - Fork 1
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
fix: force focus state to dropdown.trigger as document.activeElement
stays in body even with clicking #99
#100
Conversation
…` stays in body even with clicking #99
Reviewer's Guide by SourceryThis PR fixes a bug where the focus state was not being correctly applied to the dropdown trigger element. The fix forces focus on the trigger element when a click event occurs and the Sequence diagram for dropdown click event handling with focus fixsequenceDiagram
participant User as User
participant Trigger as Dropdown Trigger
participant Document as Document
participant AuroFloatingUI as AuroFloatingUI
User->>Trigger: Clicks dropdown
Trigger->>AuroFloatingUI: Triggers click event
AuroFloatingUI->>Document: Check activeElement
alt activeElement is body
AuroFloatingUI->>Trigger: Force focus on trigger
end
AuroFloatingUI->>AuroFloatingUI: handleClick()
State diagram for dropdown focus behaviorstateDiagram-v2
[*] --> Unfocused
Unfocused --> FocusedOnBody: Click without proper focus
FocusedOnBody --> FocusedOnTrigger: Force focus
Unfocused --> FocusedOnTrigger: Direct focus
FocusedOnTrigger --> Unfocused: Focus loss
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @sun-mota - I've reviewed your changes - here's some feedback:
Overall Comments:
- Please provide a more detailed PR description explaining the focus management issue being fixed and steps to reproduce the problem.
- The addition of @floating-ui/dom dependency needs to be explained in the PR description - is this related to the focus fix or addressing a different concern?
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
🎉 This PR is included in version 3.0.5 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Related to: AlaskaAirlines/auro-formkit#129
Alaska Airlines Pull Request
Before Submitting this pull request:
Development
sectionnote: all pull requests require at least one linked ticket
Ready For Review
, all ticket's linked underDevelopment
must have their status changed toReady For Review
as wellBy submitting this Pull Request, I confirm that my contribution is made under the terms of the Apache 2.0 license and I have performed a self-review of my own update.
Summary by Sourcery
Fix focus state management in dropdown component to ensure correct element receives focus on click.
Bug Fixes:
Enhancements:
@floating-ui/dom
for improved focus management.