MCPcopy Create free account
hub / github.com/angular/components / _scrollTo

Function _scrollTo

src/material/tabs/paginated-tab-header.ts:670–684  ·  view source on GitHub ↗

* Scrolls the header to a given position. * @param position Position to which to scroll. * @returns Information on the current scroll distance and the maximum.

(position: number)

Source from the content-addressed store, hash-verified

668 * @returns Information on the current scroll distance and the maximum.
669 */
670 private _scrollTo(position: number) {
671 if (this.disablePagination) {
672 return {maxScrollDistance: 0, distance: 0};
673 }
674
675 const maxScrollDistance = this._getMaxScrollDistance();
676 this._scrollDistance = Math.max(0, Math.min(maxScrollDistance, position));
677
678 // Mark that the scroll distance has changed so that after the view is checked, the CSS
679 // transformation can move the header.
680 this._scrollDistanceChanged = true;
681 this._checkScrollingControls();
682
683 return {maxScrollDistance, distance: this._scrollDistance};
684 }
685}

Callers

nothing calls this directly

Calls 2

maxMethod · 0.45
minMethod · 0.45

Tested by

no test coverage detected