Restore focus when a deletion happened.
()
| 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 { |
no test coverage detected