-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
DropdownMenuV2: fix active and focus-visible item glitches #64942
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
This is just a different approach. IMO:
|
That's fine since WordPress does that only for composite items receiving actual DOM focus ( |
Just to make sure I understand, you suggest using this workaround instead of using CSS |
No, I think WordPress can keep the current solution until it needs to work with composite items with virtual focus. If there are plans to introduce these components soon and they will also have distinct styles for active-item vs. focus-visible, then yes, the workaround in this PR is better. |
Got it! Since we do have one instance using virtual focus, and we're planning on exposing that prop for consumers of the component, then I guess we should switch to the solution proposed in this PR |
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.
Fix makes sense and tests well 👍
I assume your plan is to remove once the fix lands (it's already been approved) and released and we update to that release?
2b116ee
to
0807805
Compare
What?
Alternative fix to #64873
Alternative solution to remove "flash of unwanted styles" when navigating DropdownMenuV2 items using the keyboard.
Why?
Because flashing styles don't provide a great UX.
How?
Implement workaround suggested in ariakit/ariakit#4083 (comment)
Testing Instructions
Same as in #64873