coreui / coreui-free-angular-admin-template

CoreUI Angular is free Angular 18 admin template based on Bootstrap 5
https://coreui.io/product/free-angular-admin-template/
MIT License
1.71k stars 1.21k forks source link

sidebar-nav: fix dropdownMode #222

Closed ahmedsamirbek closed 2 years ago

ahmedsamirbek commented 2 years ago

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

xidedix commented 2 years ago

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

ahmedsamirbek commented 2 years ago

@xidedix I need , when open one other closed

github-actions[bot] commented 2 years ago

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

pabloinforio commented 1 year ago

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".

xidedix commented 1 year ago

@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

pabloinforio commented 1 year ago

@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.

xidedix commented 1 year ago

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

xidedix commented 1 year ago

@pabloinforio fixed in @coreui/angular@4.2.14

dropdownMode prop accepts one of the following:

<c-sidebar-nav 
  [navItems]="navItems"
  dropdownMode="close"
></c-sidebar-nav>