tooltip.ts (material2-7.3.6) | : | tooltip.ts (material2-7.3.7) | ||
---|---|---|---|---|
skipping to change at line 341 | skipping to change at line 341 | |||
_handleTouchend() { | _handleTouchend() { | |||
this.hide(this._defaultOptions.touchendHideDelay); | this.hide(this._defaultOptions.touchendHideDelay); | |||
} | } | |||
/** Create the overlay config and position strategy */ | /** Create the overlay config and position strategy */ | |||
private _createOverlay(): OverlayRef { | private _createOverlay(): OverlayRef { | |||
if (this._overlayRef) { | if (this._overlayRef) { | |||
return this._overlayRef; | return this._overlayRef; | |||
} | } | |||
const scrollableAncestors = | ||||
this._scrollDispatcher.getAncestorScrollContainers(this._elementRef); | ||||
// Create connected position strategy that listens for scroll events to repo sition. | // Create connected position strategy that listens for scroll events to repo sition. | |||
const strategy = this._overlay.position() | const strategy = this._overlay.position() | |||
.flexibleConnectedTo(this._elementRef) | .flexibleConnectedTo(this._elementRef) | |||
.withTransformOriginOn('.mat-tooltip') | .withTransformOriginOn('.mat-tooltip') | |||
.withFlexibleDimensions(false) | .withFlexibleDimensions(false) | |||
.withViewportMargin(8); | .withViewportMargin(8) | |||
.withScrollableContainers(scrollableAncestors); | ||||
const scrollableAncestors = this._scrollDispatcher | ||||
.getAncestorScrollContainers(this._elementRef); | ||||
strategy.withScrollableContainers(scrollableAncestors); | ||||
strategy.positionChanges.pipe(takeUntil(this._destroyed)).subscribe(change = > { | strategy.positionChanges.pipe(takeUntil(this._destroyed)).subscribe(change = > { | |||
if (this._tooltipInstance) { | if (this._tooltipInstance) { | |||
if (change.scrollableViewProperties.isOverlayClipped && this._tooltipIns tance.isVisible()) { | if (change.scrollableViewProperties.isOverlayClipped && this._tooltipIns tance.isVisible()) { | |||
// After position changes occur and the overlay is clipped by | // After position changes occur and the overlay is clipped by | |||
// a parent scrollable then close the tooltip. | // a parent scrollable then close the tooltip. | |||
this._ngZone.run(() => this.hide(0)); | this._ngZone.run(() => this.hide(0)); | |||
} | } | |||
} | } | |||
}); | }); | |||
End of changes. 2 change blocks. | ||||
9 lines changed or deleted | 8 lines changed or added |