Commit 71ee5be
Fix: defer initiallyFocusedKey clear by one frame to let FlashList scroll
The immediate setState in useEffect caused FlashList to see
initialScrollIndex change from truthy to falsy before it processed
the initial scroll. Using requestAnimationFrame gives FlashList one
frame to complete the scroll before the key is cleared.
Co-authored-by: mkhutornyi <mkhutornyi@users.noreply.github.com>1 parent 67a2437 commit 71ee5be
1 file changed
Lines changed: 6 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
| 52 | + | |
52 | 53 | | |
53 | 54 | | |
54 | | - | |
55 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
56 | 59 | | |
57 | 60 | | |
58 | 61 | | |
| |||
0 commit comments