Skip to content

Commit

Permalink
feat(module:menu): menu with nzMatchRouter work with CanDeactivate
Browse files Browse the repository at this point in the history
close #4407
  • Loading branch information
vthinkxie committed Jan 28, 2020
1 parent 51fbf5e commit 7560563
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion components/menu/menu.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export class NzMenuDirective implements AfterContentInit, OnInit, OnChanges, OnD
});
this.nzMenuService.descendantMenuItemClick$.pipe(takeUntil(this.destroy$)).subscribe(menu => {
this.nzClick.emit(menu);
if (this.nzSelectable) {
if (this.nzSelectable && !menu.nzMatchRouter) {
this.listOfNzMenuItemDirective.forEach(item => item.setSelectedState(item === menu));
}
});
Expand Down
1 change: 1 addition & 0 deletions components/menu/submenu.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ export class NzSubMenuComponent implements OnInit, OnDestroy, AfterContentInit,
});
/** current submenu open status **/
this.nzSubmenuService.isCurrentSubMenuOpen$.pipe(takeUntil(this.destroy$)).subscribe(open => {
this.isActive = open;
if (open !== this.nzOpen) {
this.setTriggerWidth();
this.nzOpen = open;
Expand Down

0 comments on commit 7560563

Please sign in to comment.