MCPcopy
hub / github.com/angular/components / show

Method show

src/material/tooltip/tooltip.ts:451–471  ·  view source on GitHub ↗

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})

Source from the content-addressed store, hash-verified

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 {

Callers 9

ngAfterViewInitMethod · 0.95
toggleMethod · 0.95
toggleDensityMethod · 0.45
positionMethod · 0.45
tooltip.spec.tsFile · 0.45
setPositionAndShowFunction · 0.45

Calls 8

_isTooltipVisibleMethod · 0.95
_createOverlayMethod · 0.95
_detachMethod · 0.95
_setTooltipClassMethod · 0.95
_updateTooltipMessageMethod · 0.95
afterHiddenMethod · 0.80
attachMethod · 0.65

Tested by 1

setPositionAndShowFunction · 0.36