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

Method focusEffect

src/aria/private/grid/grid.ts:331–343  ·  view source on GitHub ↗

Sets focus when active cell changed.

()

Source from the content-addressed store, hash-verified

329
330 /** Sets focus when active cell changed. */
331 focusEffect(): void {
332 const activeCell = this.activeCell();
333 const gridFocused = untracked(() => this.isFocused());
334
335 if (activeCell === undefined || !gridFocused) return;
336
337 const isRoving = untracked(() => this.inputs.focusMode() === 'roving');
338 const cellFocused = untracked(() => activeCell.isFocused());
339
340 if (isRoving && !cellFocused) {
341 activeCell.focus();
342 }
343 }
344}

Callers 1

constructorMethod · 0.80

Calls 2

isFocusedMethod · 0.65
focusMethod · 0.65

Tested by

no test coverage detected