Sets focus when active cell changed.
()
| 328 | |
| 329 | /** Sets focus when active cell changed. */ |
| 330 | focusEffect(): void { |
| 331 | const activeCell = this.activeCell(); |
| 332 | const gridFocused = untracked(() => this.isFocused()); |
| 333 | |
| 334 | if (activeCell === undefined || !gridFocused) return; |
| 335 | |
| 336 | const isRoving = untracked(() => this.inputs.focusMode() === 'roving'); |
| 337 | const cellFocused = untracked(() => activeCell.isFocused()); |
| 338 | |
| 339 | if (isRoving && !cellFocused) { |
| 340 | activeCell.focus(); |
| 341 | } |
| 342 | } |
| 343 | } |
no test coverage detected