Conversation
🛡️ Jit Security Scan Results✅ No security findings were detected in this PR
Security scan by Jit
|
…in/out of submenus
|
👀 |
nathanielwarner
left a comment
There was a problem hiding this comment.
Nice work on this! There's an incredible amount of intricate logic that I've done my best to understand. It looks visually excellent as well, and adheres to the design.
Accessibiilty is definitely a huge improvement over the current nav! I made one specific inline recommendation, and I have a couple of other notes:
- Keyboard navigation is not working properly within the sub-menus. You can navigate into them, but you cannot get out of it using the keyboard. If we're not able to fix this, we should warn on the docs page that this is only for mobile navigation and it does not meet accessibility criteria for desktop use.
- It seems like VoiceOver would work for blind users, other than the minor issue with the logo resolved by removing the
aria-labelledby. There is however some strange behavior where it's possible to get the screen reader's focus out of sync with the visual presentation. When you select "home solar" using the screen reader, the screen reader is still on the expand/collapse button even though it visually looks like it's on the first item within the sub-menu "getting started". If you then click this button again, things really fall apart and the whole menu goes white. It'd be good to fix this if we can, because it's likely to create a confusing experience for those who are visually impaired, and are able to hear things that don't correspond to what they're seeing.
Very true. For some reason it wasn't focus trapping me consistently before in submenus, but now it is. I've fixed this by adding hidden back and close buttons to each submenu, and keeping them accessible to visual users by showing a focus outline on the actual back and close buttons in the nav content header when those hidden buttons receive focus. I also discovered a pretty serious VoiceOver bug where when you went back to a parent menu, VoiceOver would lose focus and bump you back out to the top of the page (same for when you closed the menu itself). I've fixed this by explicitly giving focus to the menu trigger button just before closing the menu, so focus position is retained.
Very good catch! This was a gap in my own logic, nothing to do with Reka UI - fixed in b8492be |
nathanielwarner
left a comment
There was a problem hiding this comment.
This a fascinating set of workarounds. Fairly ugly but it seems to work pretty well. I do still see a couple of quirks:
- Within a sub-menu, navigating backwards with shift-tab will go over two invisible buttons before it gets to the ones with visible outline. One of those invisible buttons seems to do nothing, while the other seems to be another back button. Navigating forwards somehow doesn't trigger this condition.
- When navigating into a sub-menu with VoiceOver, the indicator shows the screen reader as being where it was (on the screen) prior to the click, which makes it look like it's over one of the elements on the new sub-menu. But the voice prompt (and actual behavior) show that the screen reader is still on the expand/collapse button which was just clicked. "Clicking" it again with the screen reader will get you back to the parent menu, and now with the latest round of fixes, the menu keeps up visually as well. The only issue here is the visual mismatch; the screen reader is initially pointing to an element which is no longer in the field of view.
This implementation is working well enough, and the two things mentioned above are fairly minor edge cases in my opinion, more like "nice to fix if easy".
🔗 Linked issue
❓ Type of change
📚 Description
classprop wasn't placed on the right elementstickyBarlayout to aminimallayout and used it on both the sticky bar and site navigation docs pagesFirst, second, and third level examples
Desktop behavior
🥼 Testing
🧐 Feedback Requested / Focus Areas
📝 Checklist