From e5bc3001cd9463584bc40aeec31ee788d2e0fe01 Mon Sep 17 00:00:00 2001 From: Hsuan Lee Date: Mon, 3 Aug 2020 10:13:37 +0800 Subject: [PATCH] fix(module:tabs): not emit click event from dropdown menu --- components/tabs/tab-nav-operation.component.ts | 2 ++ components/tabs/tabset.component.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/components/tabs/tab-nav-operation.component.ts b/components/tabs/tab-nav-operation.component.ts index 08a733af3e9..bb90b8d5e3e 100644 --- a/components/tabs/tab-nav-operation.component.ts +++ b/components/tabs/tab-nav-operation.component.ts @@ -82,6 +82,8 @@ export class NzTabNavOperationComponent implements OnDestroy { onSelect(item: NzTabNavItemDirective): void { if (!item.disabled) { + // ignore nzCanDeactivate + item.tab.nzClick.emit(); this.selected.emit(item); } } diff --git a/components/tabs/tabset.component.ts b/components/tabs/tabset.component.ts index 64bf5eb5af0..27e52ba7255 100644 --- a/components/tabs/tabset.component.ts +++ b/components/tabs/tabset.component.ts @@ -389,6 +389,7 @@ export class NzTabSetComponent implements OnInit, AfterContentChecked, OnDestroy clickNavItem(tab: NzTabComponent, index: number): void { if (!tab.nzDisabled) { + // ignore nzCanDeactivate tab.nzClick.emit(); this.setSelectedIndex(index); }