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

Method restoreFocusEffect

src/aria/private/grid/grid.ts:313–327  ·  view source on GitHub ↗

Restore focus when a deletion happened.

()

Source from the content-addressed store, hash-verified

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

Callers 1

constructorMethod · 0.80

Calls 3

setMethod · 0.80
isFocusedMethod · 0.65
focusMethod · 0.65

Tested by

no test coverage detected