Handles focusin events on the grid.
(event: FocusEvent)
| 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) { |
no test coverage detected