-
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
FocusVisible triggers on browser tab switch #1813
Comments
duplicate issue, but maybe something new to consider #791 |
I believe this is intended behavior. It's important for users to know where focus is when switching tabs, which is why we show the focus ring in that case. |
Is the intention here to have different behavior than the native Note that if the modality would not be changed then the keyboard user would still see the focus ring when coming back to a page since it was displayed before the user switched pages. For pointer users, the focus ring would not pop up suddenly since it wasn't displayed before the user switched pages. I understand that the modality could have changed between user has switched away and back to a page and this cannot be detected reliably within the page itself but is this that important to cover? I mean - I assume that the native behavior was chosen for a reason and it was worth the tradeoff for the authors/implementers. |
Unfortunately, the native behavior of |
Thanks for the answer! I would appreciate a status update when you do so and I can offer documenting the desired behavior then :) |
Going to re-open this. Our a11y team is not opposed to keeping the previous modality after a tab switch if we can figure out how to implement it. Sounds like it might be possible with visibility change events. If someone would like to work on a PR for that, it would be very helpful! 😃 |
@devongovett Thanks for reopening 🚀 We will try to propose a solution soon |
🐛 Bug Report
When clicking on element and then switching tab to another and back again,
isFocusVisible
returns true (see gif below).🤔 Expected Behavior
isFocusVisible
should remain false when switching tabs as long as one is not using keyboard to do so. This is maybe kind of subjective, maybe its expected if so - can anyone elaborate?😯 Current Behavior
isFocusVisible
returns true💁 Possible Solution
I've found similar error here and they resolved it by tracking
document.visibilityState
to detect tab switch as far as I understand their code.🔦 Context
We are using isFocusVisible for a11y of keyboard navigation and would rather not to display the outlines when they are not expected or necessary.
💻 Code Sample
https://react-spectrum.adobe.com/react-aria/useFocusVisible.html
🌍 Your Environment
🧢 Your Company/Team
https://www.livechat.com/
🕷 Tracking Issue (optional)
The text was updated successfully, but these errors were encountered: