question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ability to disable vertical menu when sider is collapsed

See original GitHub issue

What problem does this feature solve?

I am using angular’s BreakPointObserver to switch between an inline menu layout expanded for large screens, an inline layout collapsed with a collapsed width of 80px for medium sized screens, and an inline layout collapsed with a collapse width of 0px for mobile devices.

I have a basic working example of this here: https://stackblitz.com/edit/angular-enh6va

When in mobile view, where the menu is collapsed, the vertical menu will suddenly appear if you are redirected to one of the submenu items’s router links, and that sub menu item has routerLinkActive="ant-menu-item-selected". I do not have enough time to build a stack blitz with the router at the moment, but it looks like this when that happens (the menu is collapsed to a width of 0px on the left): screen shot 2018-07-26 at 5 20 43 pm

If there was a way to manually disable the switch to vertical menu when the inline menu is collapse, I believe it would solve the issue.

What does the proposed API look like?

Maybe a directive called disableVerticalMenu, or a separate nzMode specifically when the menu is collapsed, such as nzCollapsedMode . This is also being done in version 0.7, but I have tested in the latest stable version and seems to act the same.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
vthinkxiecommented, Sep 20, 2018

Hi @KevinStirling , I got your point now, here is the temp solution for you. https://stackblitz.com/edit/angular-enh6va-bc8hzx?file=app/app.component.ts

The key point is to add [hidden]="(collapseWidth==0)&&isCollapsed" to the menu item you don’t want to see when collapsed, you can create an directive for this. hope this can help you.

It is hard to solve it in component now, we will keep tracking on it.

0reactions
KevinStirlingcommented, Sep 19, 2018

Thanks @vthinkxie !

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bootstrap Sidebar collapsing when it shouldn't and not ...
Probably an easy CSS issue, but after going through it nothing jumps out. The generated HTML is div class="nav-side-menu"> <div class ...
Read more >
How To Create a Collapsed Sidebar - W3Schools
Learn how to create a collapsible sidebar menu. × About Services Clients Contact. Click on the button to open the collapsible sidebar: ☰...
Read more >
Left-Side Vertical Navigation on Desktop
Vertical navigation is a good fit for broad or growing IAs, but takes up more space than horizontal navigation.
Read more >
Styling navigation - Squarespace Help Center
Customize the font, color, and size of your site's navigation links. Your site's navigation is a ... Hide the collapsed menu on computers....
Read more >
Bootstrap sidebar menu collapse - Seba Online
This vertical menu is quite compatible with Bootstrap 3/4/5 CSS and also ... The collapse effect is useful when you want to hide...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found