-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Submenus shouldn't take space unless they're actually open. #31881
Conversation
Size Change: +95 B (0%) Total Size: 1.62 MB
ℹ️ View Unchanged
|
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.
I think the proposed changes make sense, but I wanted to check in on PageList behavior and whether or not clicks/hovers should display submenus.
Here's trunk behavior with Navigation block populated with PageList:
trunk.mp4
Here's the branch behavior with Navigation block populated with PageList:
submenu.mp4
7eb8e41
to
3222727
Compare
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.
LGTM.
I followed testing examples and couldn't find any obvious issues.
3222727
to
19b233a
Compare
19b233a
to
1ed3b89
Compare
Description
Currently submenus in the navigation block are
visibility: hidden;
until you tab or click into them. That, however, means they still take up space in the viewport, as opposed todisplay: none;
, which actually makes it disappear.This particular behavior meant you could have a horizontal scrollbar appear for no reason:
This PR fixes that:
On smaller viewports, nested submenus don't open rightwards, they open downwards and "stack". The alignment was off, though:
That's fixed too:
When menus have color, those rules are different, so that's tweaked too:
How has this been tested?
Please insert a navigation menu that has a bunch of nested submenu items.
Then test it with and without background colors, on small and medium (600px plus) viewport breakpoints.
Menus should look good, and there shouldn't be a horizontal scrollbar when submenu items aren't open.
Checklist:
*.native.js
files for terms that need renaming or removal).