nebular
nebular copied to clipboard
Auto collapse not working for nested menus
Issue type
I'm submitting a ... (check one with "x")
- [x] bug report
- [ ] feature request
Issue description
Current behavior: When I use the NbMenuComponent with NbMenuItem[] three levels deep, the autoCollapse doesn't close second tier menus on click of second or third tier items.
Expected behavior: When clicking on links in inner-level sub-menu's, any other open sub-menu's should close.
Steps to reproduce: Look at StackBlitz below
- Click Root level one
- Click Root level two
Here auto Collapse is working
- Click Second level two-one
- Click Third level two-one-one
- Click Second level two-two
auto Collapse should either be working here (closing Second level two-one); or
- Click Third level two-two-two
here.
Related code:
StackBlitz Auto collapse example
<nb-menu [items]="items" [autoCollapse]="true"></nb-menu>
any have solution for this bug i need it very urgent
嗯嗯,我也遇到这类问题,目前正在寻找解决方法,希望能尽快解决
The solution here is to set the parent property of nested items
The solution here is to set the
parentproperty of nested items
This worked for me, good stuff. Thanks
I think the real issue here is that parent is missing from the docs