coreui / coreui-free-angular-admin-template

CoreUI Angular is free Angular 17 admin template based on Bootstrap 5

Home Page:http://coreui.io/angular/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sidebar-nav: fix dropdownMode

ahmedsamirbek opened this issue · comments

I have issue here I need when open menu group item others collapsed

@ahmedsamirbek do you need to keep open other menu groups or to close them?

@xidedix I need , when open one other closed

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions

Any solution @xidedix? I see that the vue version (https://coreui.io/vue/docs/3.2/components/sidebar.html) has the prop dropdownMode with value closeInactive. "closeInactive - closes every inactive dropdown on route change, opens dropdown when route state is active".

@pabloinforio
CoreUI 4 for Angular - closeInactive prop of SidaberNav is the default value of dropdownMode.
It opens SidebarNavGroup - when the active route matches url for a navItem with children (navItems: INavData[])
It closes every SidebarNavGroup on route change - when the active route does not match url for a navItem with children

@xidedix
So there's no way to close one group when click in other group? I'm asking because I notice this behavior in vue (https://coreui.io/demos/vue/4.0/free/#/dashboard) and bootstrap (https://coreui.io/demos/bootstrap/4.3/default-v3/) example.

@pabloinforio
Thanks for the clarification. We'll try to fix the issue in an upcoming patch later next week.

@pabloinforio
fixed in @coreui/angular@4.2.14

dropdownMode prop accepts one of the following:

  • path: close inactive sidebar-nav-group on active route change only (default - backward compatible)
  • close: close open sidebar-nav-group on other group click
  • none: keep sidebar-nav-group open
<c-sidebar-nav 
  [navItems]="navItems"
  dropdownMode="close"
></c-sidebar-nav>