[feat] Secondary nav initial render improvement #1961
Replies: 6 comments
-
is noscript a target here? do you have usage stats that we can reference to determine how much of our audience is noscript? can we solve this in part or in whole by defaulting to closed menu and adding dsd for fouc? |
Beta Was this translation helpful? Give feedback.
-
noscript is not a target. This is about initial render (having the nav in a collapsed state by default) and because it's in a collapsed state by default, providing a fallback to allow the user to open the nav if JavaScript fails to load or something breaks. |
Beta Was this translation helpful? Give feedback.
-
After discussion with @hellogreg we talked through current possible noscript fixes and each just present a different accessibility tradeoff to users. The future goal would be DSD providing a |
Beta Was this translation helpful? Give feedback.
-
Yeah, I know from my own experience and from some articles that VoiceOver used to announce state with older versions of iOS (e.g., 11 and 12). But for some reason it does not announce state with recent versions. (iOS has never announced default roles for Sample |
Beta Was this translation helpful? Give feedback.
-
I'm not opposed to that, but mind you that Safari is a good chunk of our mobile traffic on RHDC. After all, this is the "everything has gone wrong" fallback. Currently all mobile users on slower connection speeds or lower powered devices (and a lot of our mobile traffic is Chrome) see the menu open by default and then shuffle close. |
Beta Was this translation helpful? Give feedback.
-
Moving to a Discussion, since we don't have a specific, proper solution that is both accessible and without CLS—as is the nature of all properly accessible hamburger menus. Currently documenting potential approaches. |
Beta Was this translation helpful? Give feedback.
-
Description
We've got light DOM CSS that ships along with secondary nav (Yay!) but the "open by default on mobile" state we chose is a performance regression (Boo!).
https://www.webpagetest.org/video/compare.php?tests=230601_BiDcB8_9SQ,230504_BiDcC9_CX7
Suggested solution
I believe the problem is there's not a great no-or-broken-js way to collapse the menu by default but allow it to be accessible.
I've pulled together an example of how we might be able to accomplish this with the target selector:
https://codepen.io/zackhawkins/full/BaqXwBz
@hellogreg threw together a better/different option with the following demo using a checkbox approach:
Demo: https://cdpn.io/pen/debug/BaqXwwR
Code: https://codepen.io/hellogreg/pen/BaqXwwR?editors=1100
Example API
No response
Additional context
No response
Beta Was this translation helpful? Give feedback.
All reactions