Resets the focus to the active cell element or grid element.
()
| 293 | |
| 294 | /** Resets the focus to the active cell element or grid element. */ |
| 295 | resetFocusEffect(): void { |
| 296 | const stateStale = this._stateStale(); |
| 297 | if (!stateStale) return; |
| 298 | |
| 299 | const isFocused = untracked(() => this.isFocused()); |
| 300 | const isRoving = untracked(() => this.inputs.focusMode() === 'roving'); |
| 301 | const activeCell = untracked(() => this.activeCell()); |
| 302 | |
| 303 | if (isRoving && activeCell !== undefined && isFocused) { |
| 304 | if (!activeCell.isFocused()) { |
| 305 | activeCell.focus(); |
| 306 | } |
| 307 | } |
| 308 | |
| 309 | this._stateStale.set(false); |
| 310 | } |
| 311 | |
| 312 | /** Restore focus when a deletion happened. */ |
| 313 | restoreFocusEffect(): void { |
no test coverage detected