Commit 74171ca
committed
fix(table): typewriter prevText in state, not ref (concurrent-render flash)
The render-phase reset used a ref (prevTextRef) for change detection. Under
React 18 concurrent rendering, a render can be started then discarded; the
ref mutation survives but the setRevealed('') rolls back. The committed render
then sees prevTextRef === text, skips the reset, and `revealed ?? kind.text`
paints the full value for one frame before the animation overwrites it —
an intermittent full-text flash during runs with many streaming cells.
Track the previous text in state so it rolls back with the discarded render
and the reset re-fires on the committed one. Also guard the animation effect
against a null/empty text (stale animateRef from a discarded render).1 parent d730015 commit 74171ca
1 file changed
Lines changed: 11 additions & 5 deletions
File tree
- apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/cells
Lines changed: 11 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
303 | 303 | | |
304 | 304 | | |
305 | 305 | | |
306 | | - | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
307 | 313 | | |
308 | 314 | | |
309 | 315 | | |
310 | 316 | | |
311 | 317 | | |
312 | 318 | | |
313 | | - | |
314 | | - | |
| 319 | + | |
| 320 | + | |
315 | 321 | | |
316 | 322 | | |
317 | 323 | | |
| |||
322 | 328 | | |
323 | 329 | | |
324 | 330 | | |
325 | | - | |
| 331 | + | |
326 | 332 | | |
327 | | - | |
| 333 | + | |
328 | 334 | | |
329 | 335 | | |
330 | 336 | | |
| |||
0 commit comments