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

Method focusEffect

src/aria/private/grid/grid.ts:330–342  ·  view source on GitHub ↗

Sets focus when active cell changed.

()

Source from the content-addressed store, hash-verified

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

Callers 1

constructorMethod · 0.80

Calls 2

isFocusedMethod · 0.65
focusMethod · 0.65

Tested by

no test coverage detected