-
Notifications
You must be signed in to change notification settings - Fork 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
Avoid multiple selected menu items #46050
Conversation
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: Async-loaded Components (~157 bytes added 📈 [gzipped])
React components that are loaded lazily, when a certain part of UI is displayed for the first time. Legend What is parsed and gzip size?Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory. Generated by performance advisor bot at iscalypsofastyet.com. |
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.
Thanks @getdave !
It looks and works as expected! I am a little bit concerned about missing CSS variables, but let's merge this and @frontdevde can consolidate the changes with Nav unification: add flyout menu to sidebar!
As described in this Issue it is possible to arrive at a state whereby several menu items appear to be "selected" at once.
This PR adjusts things so that only one menu item ever appears in the "blue" selected state. Moreover the logic for deciding which item is "selected" is moved upward in order that:
Moreover, an appropriate "selected" style is added to child selected links to match WPAdmin.
Screenshots
📺 You can watch this demo video.
Testing instructions
Posts
section remains expanded, but not selected.Tools -> Earn
. You shoud see the sub-item "Earn" in a selected state as well as the top level "Tools" item (note this exactly matches the WPAdmin experience - go try it out!).Posts
andPages
sections remain expanded, but not selected.?flags=nav-unification
to the URL). You should see theTools
section auto-expanded and theEarn
item should be selected.Fixes #46039