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

Method onFocusIn

src/aria/private/grid/grid.ts:232–248  ·  view source on GitHub ↗

Handles focusin events on the grid.

(event: FocusEvent)

Source from the content-addressed store, hash-verified

230
231 /** Handles focusin events on the grid. */
232 onFocusIn(event: FocusEvent) {
233 this.isFocused.set(true);
234 this.hasBeenInteracted.set(true);
235
236 // Cell that receives focus.
237 const cell = this.inputs.getCell(_getEventTarget(event));
238 if (!cell || !this.gridBehavior.focusBehavior.isFocusable(cell)) return;
239
240 // Pass down the focusin event to the cell.
241 cell.onFocusIn(event);
242
243 // Update active cell state if the cell is receiving focus by
244 // tabbing, pointer, or any programmatic control into a widget inside the cell.
245 if (cell !== this.activeCell()) {
246 this.gridBehavior.gotoCell(cell);
247 }
248 }
249
250 /** Handles focusout events on the grid. */
251 onFocusOut(event: FocusEvent) {

Callers 1

grid.spec.tsFile · 0.45

Calls 5

_getEventTargetFunction · 0.90
setMethod · 0.80
getCellMethod · 0.80
isFocusableMethod · 0.45
gotoCellMethod · 0.45

Tested by

no test coverage detected