Skip to content

Commit

Permalink
fix(module:tooltip): fix hiding when hover popover (NG-ZORRO#4418)
Browse files Browse the repository at this point in the history
* fix(module:tooltip): fix hiding when hover popover

* fix(module:tooltip): fix accessing destroyed view

close NG-ZORRO#4417
  • Loading branch information
Wendell authored and Ricbet committed Apr 9, 2020
1 parent a945068 commit 71cffa5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions components/tooltip/base/nz-tooltip-base.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ export abstract class NzTooltipBaseDirective implements OnChanges, OnInit, OnDes
this.$destroy.complete();

// Clear toggling timer. Issue #3875 #4317 #4386
this.hide();
this.clearTogglingTimer();
this.removeTriggerListeners();

Expand Down Expand Up @@ -342,9 +341,9 @@ export abstract class NzTooltipBaseDirective implements OnChanges, OnInit, OnDes
}

private delayEnterLeave(isOrigin: boolean, isEnter: boolean, delay: number = -1): void {
this.clearTogglingTimer();

if (delay > 0) {
if (this.delayTimer) {
this.clearTogglingTimer();
} else if (delay > 0) {
this.delayTimer = setTimeout(() => {
this.delayTimer = undefined;
isEnter ? this.show() : this.hide();
Expand Down

0 comments on commit 71cffa5

Please sign in to comment.