-
Notifications
You must be signed in to change notification settings - Fork 179
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
fix(app): remove nav focus state on app load #11068
Conversation
Codecov Report
@@ Coverage Diff @@
## release_6.0.0 #11068 +/- ##
=================================================
+ Coverage 73.78% 73.79% +0.01%
=================================================
Files 2082 2084 +2
Lines 57535 58089 +554
Branches 5806 6003 +197
=================================================
+ Hits 42452 42867 +415
- Misses 13800 13910 +110
- Partials 1283 1312 +29
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
Does this also remove the ability to focus on the current Navbar
selection? (Protocols
doesn't have a focus-visible
state now)
Screen.Recording.2022-07-11.at.9.36.31.AM.mov
yeah it does unfortunately. i havent been able to come up with an actual fix. |
Correction, it doesnt remove the ability to focus on the current item, it removes the focus state when one does focus on the current item. this might be an acceptable tradeoff since there really isnt much of a reason to click on the currently active tab |
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.
This is an acceptable compromise for now. Thanks for investigating!
Overview
This will remove the focus state in the nav on app load. According to the following issue in the w3c css working group, the
focus-visible
state on page load is expected behavior: w3c/csswg-drafts#5885 (i think, this discussion is not always easy to follow)This is because on page load the app is programmatically moving focus to this element via react router and for accessibility reasons if focus is moved programmatically when no prior element is focused (such as on page load) the focus-visible selector is active. At least that's how I understand the discussion there.
We can keep the focus-visible on load, or implement some solution such as I've done here, which is to remove the focus-visible from the currently active item. A better fix would be to prevent react router from focusing on the nav element but i havent found a way to do that yet.
Changelog
Review requests
Check that on app load nav item is not in focus-visible state
Risk assessment
Low