Skip to content

Commit 7ab31a7

Browse files
committed
fix(sidebar-nav): sidebarNavGroup with nested submenu behavior for same path and dropdownMode="close"
1 parent 3d97f47 commit 7ab31a7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

projects/coreui-angular/src/lib/sidebar/sidebar-nav/sidebar-nav.component.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,13 @@ export class SidebarNavGroupComponent implements OnInit, OnDestroy {
144144

145145
this.navGroupSubscription = this.sidebarNavGroupService.sidebarNavGroupState$.subscribe(next => {
146146
if (this.dropdownMode === 'close' && next.sidebarNavGroup && next.sidebarNavGroup !== this) {
147+
if (next.sidebarNavGroup.item.url.startsWith(this.item.url)) {
148+
return;
149+
}
150+
if (this.samePath(this.router.routerState.snapshot.url)) {
151+
this.openGroup(true);
152+
return;
153+
}
147154
this.openGroup(false);
148155
}
149156
});

0 commit comments

Comments
 (0)