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