nebular icon indicating copy to clipboard operation
nebular copied to clipboard

NbSidebar: menu item toggled when expanding sidebar

Open yggg opened this issue 6 years ago • 5 comments

Issue type

I'm submitting a ... (check one with "x")

  • [x] bug report
  • [ ] feature request

Issue description

When sidebar is compacted, clicking on menu item with submenu causes menu item toggling.

Current behavior: Menu item 'expanded' state changed after each click.

Expected behavior: Clicked menu item should always be expanded.

Steps to reproduce:

  1. Go to ngx-admin.
  2. Shrink viewport to the size when sidebar is compacted.
  3. Click on any menu item which has submenu.
  4. Collapse sidebar.
  5. Repeat steps 3 and 4 several times.

Every time menu item has a different state.

Related code: https://github.com/akveo/nebular/blob/7542d5ed11a6556b7a91c4209e58a878daed37fa/src/framework/theme/components/sidebar/sidebar.component.ts#L296 https://github.com/akveo/nebular/blob/7542d5ed11a6556b7a91c4209e58a878daed37fa/src/framework/theme/components/menu/menu-item.component.html#L36

Other information:

npm, node, OS, Browser

any

Angular, Nebular

@nebular/theme: "2.0.0-rc.10"

yggg avatar Aug 13 '18 12:08 yggg

The issue is not reproducing in the Nebular 2.0.1 version.

lexzhukov avatar Oct 15 '18 14:10 lexzhukov

@lexzhukov Bug still present (version 3.0.0). Please check current demo page.

efuturetoday avatar Jan 16 '19 17:01 efuturetoday

In the current implementation, the sidebar and menu are not aware of each other. The current behavior is not very nice, looks like a bug.

bppn avatar May 21 '19 20:05 bppn

This is still an issue. It is also present in the demo https://www.akveo.com/ngx-admin/pages/iot-dashboard

Setting up the situation:

  • A menu component inside a sidebar component (the intended use for these components)
  • The menu has a submenu
  • The submenu is open
  • User collapses the sidebar, hiding the items inside the submenu but leaving the button for the submenu toggle The problem:
  • If the user clicks on the submenu it opens the sidebar but collapses the submenu

Expected behaviour:

  • If the user clicks on a submenu in a collapsed sidebar it should open the sidebar and the submenu, not "toggle" the submenu

DannydeJong avatar Oct 12 '21 14:10 DannydeJong

Any information when this will be merged?

abelokon0711 avatar Apr 21 '22 19:04 abelokon0711