nebular icon indicating copy to clipboard operation
nebular copied to clipboard

Auto collapse not working for nested menus

Open thebeard opened this issue 5 years ago • 6 comments

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>

thebeard avatar Mar 06 '20 08:03 thebeard

any have solution for this bug i need it very urgent

oveshparasara avatar Apr 30 '20 15:04 oveshparasara

嗯嗯,我也遇到这类问题,目前正在寻找解决方法,希望能尽快解决

Zuoxiaoxian avatar Nov 29 '20 12:11 Zuoxiaoxian

The solution here is to set the parent property of nested items

lluchkaa avatar Sep 21 '22 10:09 lluchkaa

The solution here is to set the parent property of nested items

This worked for me, good stuff. Thanks

I think the real issue here is that parent is missing from the docs

DiegoAndresCortes avatar Oct 05 '22 17:10 DiegoAndresCortes