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

Method focus

src/cdk/tree/tree.ts:1428–1435  ·  view source on GitHub ↗

Focuses this data node. Implemented for TreeKeyManagerItem.

()

Source from the content-addressed store, hash-verified

1426
1427 /** Focuses this data node. Implemented for TreeKeyManagerItem. */
1428 focus(): void {
1429 this._tabindex = 0;
1430 if (this._shouldFocus) {
1431 this._elementRef.nativeElement.focus();
1432 }
1433
1434 this._changeDetectorRef.markForCheck();
1435 }
1436
1437 /** Defocus this data node. */
1438 unfocus(): void {

Callers

nothing calls this directly

Calls 2

markForCheckMethod · 0.80
focusMethod · 0.65

Tested by

no test coverage detected