-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Dialog doesn't restore focus to the trigger button on Safari #1643
Comments
@diegohaz @RobinMalfait I think this is by design from Apple. I cannot tab focus anywhere on any site if I don't allow it from Safari settings. See: |
@juliantroeps That's not the same thing. That macOS option allows tabbing through links. Tabbing through buttons and other tabbable elements works as expected, even when that option is unchecked. The issue here is that Safari doesn't focus on buttons on mouse down, not when tabbing. |
windows chrome version v72.0.3626.81 experiencing the same problem |
Hey, thank you for this bug report! 🙏 This should be fixed by #2326, and will be available in the next release. You can already try it using:
|
What package within Headless UI are you using?
@headlessui/react, @headlessui/vue
What version of that package are you using?
latest on the site
What browser are you using?
Safari
Reproduction URL
https://headlessui.com/react/dialog
Describe your issue
Notice that the Dialog doesn't open again as it does on other browsers because the focus is not restored to the "Open dialog" button.
I believe this happens because Headless UI may be relying on buttons receiving focus when they get clicked to restore it when the dialog closes, but Safari doesn't focus on buttons on mouse down.
The text was updated successfully, but these errors were encountered: