-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
feat(core): update nav to work better on mobile and when collapsed #66313
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
Conversation
Starting to look really solid! A few questions/comments about the UI/code
Did you have a change to try this out on a physical phone? A lot of weird stuff pops up there! As for the code, everything looks reasonable, but a few questions:
|
@gggritso I'm going to go through all those bugs! The reopening subitem thing is because the "onclickoutside" is firing which closes it, and then the "onMainItemClick" fires which reopens it! I can probably do something where onClickOutside ignores clicks on the "mainItem" in the sidebar. This was mb, i quickly added the onClickOutside last minute
So the context is actually around the entire sidebar, that way each accordion can share state of what's currently open. This would only be used in the state where the sub items should be floating (mobile or sidebar collapsed), I suppose technically you can get away from omitting this shared state, and can manage it locally, is this what you mean? When clicking from one set of sub items to the next, we would be relying on the "onClickOutside" to close the current sub items, and then the onclick of the next accoridion would open the new sub menus. This to me sounds less intuitive and less robust, theoretically its possible that both accordions have sub menus open with this approach, sharing one state of what's open accross accordions would only ever allow one set of sub items to open at once.
It shouldn't clash at all, the accoridan expanded/setExpanded local storage state is not applicable to the "floating" sub items, only to the original expand/collapse sidebar behaviour. This makes total sense imo, because when its not in a "floating" state, we are able to open multiple submenu items at once, so we can't rely on the global state that tells us what's open. And we want to be able to refresh and the same sub-items are open (which is not applicable in the floating state)
Yeah that's totally fair! What its trying to say, is that the subitem should be "floating" when expanded, what if we did "shouldSubItemFloat"? But I like your idea of setting via the accoridon, sounds a little more bullet proof, will dig into that!
Yeah this sounds possible actually, and I don't think its too complicated, I'll give it a go! |
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 for explaining everything! I get what you're doing now, and I like this approach 👍🏻 This time leaving some actual more specific line comments
Looking good, very close now
Bundle ReportChanges will increase total bundle size by 49.07kB ⬆️
|
Let's use the ![]() |
@vuluongj20 updated to use the |
@DominikB2014 okay last one I promise 😄 Let's remove some of the padding around the menu items? ![]() |
@vuluongj20 Made the changes to match the padding! |
Updates the nav according to the following mock, the sidebar currently doesn't do anything like the last settings example, so this case hasn't been considered for this version, but we can add it in the future
It would be super helpful for any reviewers to play around with it!