From dbc2cd346b880607e1b12ae6f14150c47f469b28 Mon Sep 17 00:00:00 2001 From: rppig42 <48581046+rppig42@users.noreply.github.com> Date: Fri, 17 Apr 2020 19:36:37 +0800 Subject: [PATCH] fix(module:popover): fix programmatically changing not trigger ngModelChange (#5053) Co-authored-by: SamYum --- components/tooltip/base.ts | 1 + components/tooltip/tooltip.spec.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/components/tooltip/base.ts b/components/tooltip/base.ts index f0979092265..43169a98cb6 100644 --- a/components/tooltip/base.ts +++ b/components/tooltip/base.ts @@ -352,6 +352,7 @@ export abstract class NzTooltipBaseComponent implements OnDestroy { const visible = toBoolean(value); if (this._visible !== visible) { this._visible = visible; + this.nzVisibleChange.next(visible); } } diff --git a/components/tooltip/tooltip.spec.ts b/components/tooltip/tooltip.spec.ts index 5ee12fc9134..9e10e659b98 100644 --- a/components/tooltip/tooltip.spec.ts +++ b/components/tooltip/tooltip.spec.ts @@ -117,12 +117,12 @@ describe('nz-tooltip', () => { component.visible = true; waitingForTooltipToggling(); expect(overlayContainerElement.textContent).toContain(title); - expect(component.visibilityTogglingCount).toBe(0); + expect(component.visibilityTogglingCount).toBe(1); component.visible = false; waitingForTooltipToggling(); expect(overlayContainerElement.textContent).not.toContain(title); - expect(component.visibilityTogglingCount).toBe(0); + expect(component.visibilityTogglingCount).toBe(2); })); });