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

Function _scrollHeader

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

* Moves the tab list in the 'before' or 'after' direction (towards the beginning of the list or * the end of the list, respectively). The distance to scroll is computed to be a third of the * length of the tab list view window. * * This is an expensive call that forces a layout reflow to

(direction: ScrollDirection)

Source from the content-addressed store, hash-verified

487 * should be called sparingly.
488 */
489 _scrollHeader(direction: ScrollDirection) {
490 const viewLength = this._tabListContainer.nativeElement.offsetWidth;
491
492 // Move the scroll distance one-third the length of the tab list's viewport.
493 const scrollAmount = ((direction == 'before' ? -1 : 1) * viewLength) / 3;
494
495 return this._scrollTo(this._scrollDistance + scrollAmount);
496 }
497
498 /** Handles click events on the pagination arrows. */
499 _handlePaginatorClick(direction: ScrollDirection) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected