You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the Dropdown Menu example.
Accessibility rules are requiring that the triggering element that opens the menu should receive it back when the menu is closed. This was working well until and including version @floating-ui/react@0.26.9.
Versions @floating-ui/react@0.26.10 (and above) are breaking that behavior.
To Reproduce
Steps to reproduce the behavior (do not use Safari):
Click on the first button, the focus ring indicates it is focused.
Click on the second button to open the menu.
Click on the second button again, to close the menu.
Expected behavior
the Menu button should be focused.
Actual behavior
The first button gets the focus back.
Context:
OS: Mac / Windows
Browser Chrome
Version 122
Additional context
I'm not looking at Safari since this browser does not report visible focus on click of a button.
With the exact same example code, simply switching from @floating-ui/react@0.26.10 to @floating-ui/react@0.26.9 resolves the issue (focus remains on the Menu button, when the menu is closed).
The text was updated successfully, but these errors were encountered:
This is due to the reference not being focused initially, since it opens on mousedown in which the useClick hook prevents it from recieving focus. The change caused it to use the actual previously focused element instead, but the reference is still likely more appropriate here.
Describe the bug
I'm using the Dropdown Menu example.
Accessibility rules are requiring that the triggering element that opens the menu should receive it back when the menu is closed. This was working well until and including version
@floating-ui/react@0.26.9
.Versions
@floating-ui/react@0.26.10
(and above) are breaking that behavior.To Reproduce
Steps to reproduce the behavior (do not use Safari):
Expected behavior
Actual behavior
Context:
Additional context
@floating-ui/react@0.26.10
to@floating-ui/react@0.26.9
resolves the issue (focus remains on the Menu button, when the menu is closed).The text was updated successfully, but these errors were encountered: