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
fix: Cut the navbar items when it's too long (#2785) #2787
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
@RiverTwilight is attempting to deploy a commit to the Vercel Team on Vercel. A member of the Team first needs to authorize it. |
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.
now dropdown with type: 'menu'
is hidden while opening
Screen.Recording.2024-03-15.at.01.14.25.mov
})} | ||
|
||
<div className="nx-flex-auto nx-overflow-auto"> | ||
<div className="nx-flex nx-flex-row-reverse"> |
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.
seems like now all links are in reversed order
@dimaMachina The problems you mentioned are addressed. Currently if the menu is too long the search bar will be pushed out of the viewport, and the whole page will be scrollable on x-axis, which it's the best workaround, I think. |
I might be overcomplicating things but ideally I'd like to see the hamburger kick in as soon as the sum of the total navbar items width starts exceeding the current viewport width. So if someone created 100 categories, it would immediately start off as hamburger menu, even on fullscreen. |
this would be a perfect fix, not sure how to properly implement it, without overcomplicating things, any ideas are welcome Also, I would accept the solution with |
Yes. I've thought about this idea but this might need JS to intercept, which makes the Navbar heavier, since we need dynamically measure the width of the available size and the horizontal stack width. Whatever I'll give another shot soon. There is no native CSS workaround to do this as far as I know. The |
@dimaMachina Now it should be the expected behavior you want. If the items are too long it will be moved to sidebar, which's similar to mobile screen. Since the sidebar & hamburger share the same content, it's oevrcomplicated to let the hamburger contain the nav items and sidebar remains unchanged under overflow context. Under the hoodI use JS to measure the nav items width and the available width. The Feel free to drop any comment! |
I believe this won't work for pages that use raw or full layout theme which is often used for landing pages.
|
This pull request addresses issue #2785, ensuring that when the navbar has many items or items with long names, the overflow is managed elegantly without pushing the logo out of view.
Previously, an overflow of menu items caused layout issues, leading to a cluttered and inaccessible navbar.
Before
After
It's important to note that for most configurations, the visual appearance of the navbar remains unchanged: