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

[Tooltip] Opens on focus in Safari when :focus-visible isn't applied in some cases #1217

Open
atomiks opened this issue Dec 23, 2024 · 0 comments
Labels
browser: Safari bug 🐛 Something doesn't work component: tooltip This is the name of the generic UI component, not the React module!

Comments

@atomiks
Copy link
Contributor

atomiks commented Dec 23, 2024

Safari has/had a bug where it has to use a fallback to detect :focus-visible, but it doesn't work when a pointer event hasn't fired on the trigger yet.

Possibly remove the polyfill or find a fix for it.

Source: https://github.com/floating-ui/floating-ui/blob/b80ccaf9cfd7f80f28546906c60284c8385940f0/packages/react/src/hooks/useFocus.ts#L118-L130

keyboardModalityRef.current is true upon mount, and only gets set to false if it detects onPointerDown on the reference, which doesn't occur when a trigger is the first element focused inside a dialog for instance.

Workaround

Currently it can be worked around by setting the initialFocus on an element without a tooltip, or the popup itself.

@atomiks atomiks added bug 🐛 Something doesn't work component: tooltip This is the name of the generic UI component, not the React module! browser: Safari labels Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
browser: Safari bug 🐛 Something doesn't work component: tooltip This is the name of the generic UI component, not the React module!
Projects
None yet
Development

No branches or pull requests

1 participant