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

Method restoreFocusEffect

src/aria/private/grid/grid.ts:314–328  ·  view source on GitHub ↗

Restore focus when a deletion happened.

()

Source from the content-addressed store, hash-verified

312
313 /** Restore focus when a deletion happened. */
314 restoreFocusEffect(): void {
315 const deletion = this._deletion();
316 if (!deletion) return;
317
318 const isRoving = untracked(() => this.inputs.focusMode() === 'roving');
319 const activeCell = untracked(() => this.activeCell());
320
321 if (isRoving && activeCell !== undefined) {
322 if (!activeCell.isFocused()) {
323 activeCell.focus();
324 }
325 }
326
327 this._deletion.set(false);
328 }
329
330 /** Sets focus when active cell changed. */
331 focusEffect(): void {

Callers 1

constructorMethod · 0.80

Calls 3

setMethod · 0.80
isFocusedMethod · 0.65
focusMethod · 0.65

Tested by

no test coverage detected