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

Method _tabFocusChanged

src/material/tabs/tab-group.ts:567–575  ·  view source on GitHub ↗

Callback for when the focused state of a tab has changed.

(focusOrigin: FocusOrigin, index: number)

Source from the content-addressed store, hash-verified

565
566 /** Callback for when the focused state of a tab has changed. */
567 _tabFocusChanged(focusOrigin: FocusOrigin, index: number) {
568 // Mouse/touch focus happens during the `mousedown`/`touchstart` phase which
569 // can cause the tab to be moved out from under the pointer, interrupting the
570 // click sequence (see #21898). We don't need to scroll the tab into view for
571 // such cases anyway, because it will be done when the tab becomes selected.
572 if (focusOrigin && focusOrigin !== 'mouse' && focusOrigin !== 'touch') {
573 this._tabHeader.focusIndex = index;
574 }
575 }
576
577 /**
578 * Callback invoked when the centered state of a tab body changes.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected