Shows the tooltip after the delay in ms, defaults to tooltip-delay-show or 0ms if no input
(delay: number = this.showDelay, origin?: {x: number; y: number})
| 449 | |
| 450 | /** Shows the tooltip after the delay in ms, defaults to tooltip-delay-show or 0ms if no input */ |
| 451 | show(delay: number = this.showDelay, origin?: {x: number; y: number}): void { |
| 452 | if (this.disabled || !this.message || this._isTooltipVisible()) { |
| 453 | this._tooltipInstance?._cancelPendingAnimations(); |
| 454 | return; |
| 455 | } |
| 456 | |
| 457 | const overlayRef = this._createOverlay(origin); |
| 458 | this._detach(); |
| 459 | this._portal = |
| 460 | this._portal || new ComponentPortal(this._tooltipComponent, this._viewContainerRef); |
| 461 | const instance = (this._tooltipInstance = overlayRef.attach(this._portal).instance); |
| 462 | instance._triggerElement = this._elementRef.nativeElement; |
| 463 | instance._mouseLeaveHideDelay = this._hideDelay; |
| 464 | instance |
| 465 | .afterHidden() |
| 466 | .pipe(takeUntil(this._destroyed)) |
| 467 | .subscribe(() => this._detach()); |
| 468 | this._setTooltipClass(this._tooltipClass); |
| 469 | this._updateTooltipMessage(); |
| 470 | instance.show(delay); |
| 471 | } |
| 472 | |
| 473 | /** Hides the tooltip after the delay in ms, defaults to tooltip-delay-hide or 0ms if no input */ |
| 474 | hide(delay: number = this.hideDelay): void { |