Skip to content

Commit 0e96638

Browse files
authored
fix: modify FlashList scrollto workaround and provide upstream fix (#3609)
## 🎯 Goal In the pursuit of finding a better workaround for [this PR](#3608), I believe I've found the underlying cause (or part of it at least) for why the issue actually happens. The technical details are in [this upstream PR](Shopify/flash-list#2290) for `FlashList`. ## 🛠 Implementation details <!-- Provide a description of the implementation --> ## 🎨 UI Changes <!-- Add relevant screenshots --> <details> <summary>iOS</summary> <table> <thead> <tr> <td>Before</td> <td>After</td> </tr> </thead> <tbody> <tr> <td> <!--<img src="" /> --> </td> <td> <!--<img src="" /> --> </td> </tr> </tbody> </table> </details> <details> <summary>Android</summary> <table> <thead> <tr> <td>Before</td> <td>After</td> </tr> </thead> <tbody> <tr> <td> <!--<img src="" /> --> </td> <td> <!--<img src="" /> --> </td> </tr> </tbody> </table> </details> ## 🧪 Testing <!-- Explain how this change can be tested (or why it can't be tested) --> ## ☑️ Checklist - [ ] I have signed the [Stream CLA](https://docs.google.com/forms/d/e/1FAIpQLScFKsKkAJI7mhCr7K9rEIOpqIDThrWxuvxnwUq2XkHyG154vQ/viewform) (required) - [ ] PR targets the `develop` branch - [ ] Documentation is updated - [ ] New code is tested in main example apps, including all possible scenarios - [ ] SampleApp iOS and Android - [ ] Expo iOS and Android
1 parent 04f9508 commit 0e96638

4 files changed

Lines changed: 133 additions & 9 deletions

File tree

examples/SampleApp/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"lint-fix": "eslint . --fix",
1717
"extract-changelog": "FILTER_PATH='examples/SampleApp' TAG_FORMAT=$npm_package_name'@v${version}' node ../../release/extract-changelog.js",
1818
"bootstrap": "yarn install",
19+
"postinstall": "patch-package",
1920
"release": "FILTER_PATH='examples/SampleApp' TAG_FORMAT=$npm_package_name'@v${version}' node ../../release/prod",
2021
"release-next": "echo \"Skipping next release for SampleApp\"",
2122
"test:unit": "echo \"Skipping unit tests for SampleApp\"",
@@ -83,6 +84,8 @@
8384
"eslint-plugin-react-hooks": "^5.2.0",
8485
"eslint-plugin-react-native": "^5.0.0",
8586
"jest": "^30.0.0",
87+
"patch-package": "^8.0.1",
88+
"postinstall-postinstall": "^2.1.0",
8689
"prettier": "^3.5.3",
8790
"react-test-renderer": "19.1.0",
8891
"typescript": "5.8.3",
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
diff --git a/node_modules/@shopify/flash-list/dist/recyclerview/hooks/useBoundDetection.js b/node_modules/@shopify/flash-list/dist/recyclerview/hooks/useBoundDetection.js
2+
index 767fc5d..f8d4644 100644
3+
--- a/node_modules/@shopify/flash-list/dist/recyclerview/hooks/useBoundDetection.js
4+
+++ b/node_modules/@shopify/flash-list/dist/recyclerview/hooks/useBoundDetection.js
5+
@@ -100,6 +100,14 @@ export function useBoundDetection(recyclerViewManager, scrollViewRef) {
6+
}
7+
}, [recyclerViewManager]);
8+
const runAutoScrollToBottomCheck = useCallback(() => {
9+
+ // Suppress MVCP autoscroll while a programmatic scrollToIndex is in
10+
+ // flight. FlashList disables offset projection at the start of
11+
+ // scrollToIndex and re-enables it ~200-300ms after settling. Without
12+
+ // this guard, the sticky pendingAutoscrollToBottom ref races against
13+
+ // scrollToIndex and fires scrollToEnd mid-flight.
14+
+ if (!recyclerViewManager.isOffsetProjectionEnabled) {
15+
+ return;
16+
+ }
17+
if (pendingAutoscrollToBottom.current) {
18+
pendingAutoscrollToBottom.current = false;
19+
requestAnimationFrame(() => {

examples/SampleApp/yarn.lock

Lines changed: 107 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3346,6 +3346,11 @@
33463346
resolved "https://registry.yarnpkg.com/@vscode/sudo-prompt/-/sudo-prompt-9.3.1.tgz#c562334bc6647733649fd42afc96c0eea8de3b65"
33473347
integrity sha512-9ORTwwS74VaTn38tNbQhsA5U44zkJfcb0BdTSyyG6frP4e8KMtHuTXYmwefe5dpL8XB1aGSIVTaLjD3BbWb5iA==
33483348

3349+
"@yarnpkg/lockfile@^1.1.0":
3350+
version "1.1.0"
3351+
resolved "https://registry.yarnpkg.com/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz#e77a97fbd345b76d83245edcd17d393b1b41fb31"
3352+
integrity sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==
3353+
33493354
abort-controller@^3.0.0:
33503355
version "3.0.0"
33513356
resolved "https://registry.yarnpkg.com/abort-controller/-/abort-controller-3.0.0.tgz#eaf54d53b62bae4138e809ca225c8439a6efb392"
@@ -3981,7 +3986,7 @@ ci-info@^2.0.0:
39813986
resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46"
39823987
integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==
39833988

3984-
ci-info@^3.2.0:
3989+
ci-info@^3.2.0, ci-info@^3.7.0:
39853990
version "3.9.0"
39863991
resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.9.0.tgz#4279a62028a7b1f262f3473fc9605f5e218c59b4"
39873992
integrity sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==
@@ -5087,6 +5092,13 @@ find-up@^5.0.0:
50875092
locate-path "^6.0.0"
50885093
path-exists "^4.0.0"
50895094

5095+
find-yarn-workspace-root@^2.0.0:
5096+
version "2.0.0"
5097+
resolved "https://registry.yarnpkg.com/find-yarn-workspace-root/-/find-yarn-workspace-root-2.0.0.tgz#f47fb8d239c900eb78179aa81b66673eac88f7bd"
5098+
integrity sha512-1IMnbjt4KzsQfnhnzNd8wUEgXZ44IzZaZmnLYx7D5FZlaHt2gW20Cri8Q+E/t5tIj4+epTBub+2Zxu/vNILzqQ==
5099+
dependencies:
5100+
micromatch "^4.0.2"
5101+
50905102
firebase@11.3.1:
50915103
version "11.3.1"
50925104
resolved "https://registry.yarnpkg.com/firebase/-/firebase-11.3.1.tgz#1507b2b1e3af17418fbe009e82d7bc30a6b5117c"
@@ -5201,6 +5213,15 @@ fresh@0.5.2:
52015213
resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7"
52025214
integrity sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==
52035215

5216+
fs-extra@^10.0.0:
5217+
version "10.1.0"
5218+
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.1.0.tgz#02873cfbc4084dde127eaa5f9905eef2325d1abf"
5219+
integrity sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==
5220+
dependencies:
5221+
graceful-fs "^4.2.0"
5222+
jsonfile "^6.0.1"
5223+
universalify "^2.0.0"
5224+
52045225
fs-extra@^8.1.0:
52055226
version "8.1.0"
52065227
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0"
@@ -5384,7 +5405,7 @@ gopd@^1.0.1, gopd@^1.2.0:
53845405
resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.2.0.tgz#89f56b8217bdbc8802bd299df6d7f1081d7e51a1"
53855406
integrity sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==
53865407

5387-
graceful-fs@^4.1.3, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.11, graceful-fs@^4.2.4, graceful-fs@^4.2.9:
5408+
graceful-fs@^4.1.11, graceful-fs@^4.1.3, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.11, graceful-fs@^4.2.4, graceful-fs@^4.2.9:
53885409
version "4.2.11"
53895410
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3"
53905411
integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==
@@ -6498,6 +6519,17 @@ json-stable-stringify-without-jsonify@^1.0.1:
64986519
resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651"
64996520
integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==
65006521

6522+
json-stable-stringify@^1.0.2:
6523+
version "1.3.0"
6524+
resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.3.0.tgz#8903cfac42ea1a0f97f35d63a4ce0518f0cc6a70"
6525+
integrity sha512-qtYiSSFlwot9XHtF9bD9c7rwKjr+RecWT//ZnPvSmEjpV5mmPOCN4j8UjY5hbjNkOwZ/jQv3J6R1/pL7RwgMsg==
6526+
dependencies:
6527+
call-bind "^1.0.8"
6528+
call-bound "^1.0.4"
6529+
isarray "^2.0.5"
6530+
jsonify "^0.0.1"
6531+
object-keys "^1.1.1"
6532+
65016533
json5@^2.2.3:
65026534
version "2.2.3"
65036535
resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283"
@@ -6510,6 +6542,20 @@ jsonfile@^4.0.0:
65106542
optionalDependencies:
65116543
graceful-fs "^4.1.6"
65126544

6545+
jsonfile@^6.0.1:
6546+
version "6.2.1"
6547+
resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.2.1.tgz#b6e31717f22cc37330b081ce0051ed5de53af2f6"
6548+
integrity sha512-zwOTdL3rFQ/lRdBnntKVOX6k5cKJwEc1HdilT71BWEu7J41gXIB2MRp+vxduPSwZJPWBxEzv4yH1wYLJGUHX4Q==
6549+
dependencies:
6550+
universalify "^2.0.0"
6551+
optionalDependencies:
6552+
graceful-fs "^4.1.6"
6553+
6554+
jsonify@^0.0.1:
6555+
version "0.0.1"
6556+
resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.1.tgz#2aa3111dae3d34a0f151c63f3a45d995d9420978"
6557+
integrity sha512-2/Ki0GcmuqSrgFyelQq9M05y7PS0mEwuIzrf3f1fPqkVDVRvZrPZtVSMHxdgo8Aq0sxAOb/cr2aqqA3LeWHVPg==
6558+
65136559
jsonwebtoken@^9.0.2:
65146560
version "9.0.2"
65156561
resolved "https://registry.yarnpkg.com/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz#65ff91f4abef1784697d40952bb1998c504caaf3"
@@ -6593,6 +6639,13 @@ keyv@^4.5.4:
65936639
dependencies:
65946640
json-buffer "3.0.1"
65956641

6642+
klaw-sync@^6.0.0:
6643+
version "6.0.0"
6644+
resolved "https://registry.yarnpkg.com/klaw-sync/-/klaw-sync-6.0.0.tgz#1fd2cfd56ebb6250181114f0a581167099c2b28c"
6645+
integrity sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ==
6646+
dependencies:
6647+
graceful-fs "^4.1.11"
6648+
65966649
kleur@^3.0.3:
65976650
version "3.0.3"
65986651
resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e"
@@ -7026,7 +7079,7 @@ metro@0.82.5, metro@^0.82.2:
70267079
ws "^7.5.10"
70277080
yargs "^17.6.2"
70287081

7029-
micromatch@^4.0.0, micromatch@^4.0.4, micromatch@^4.0.8:
7082+
micromatch@^4.0.0, micromatch@^4.0.2, micromatch@^4.0.4, micromatch@^4.0.8:
70307083
version "4.0.8"
70317084
resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.8.tgz#d66fa18f3a47076789320b9b1af32bd86d9fa202"
70327085
integrity sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==
@@ -7085,6 +7138,11 @@ minimatch@^9.0.4:
70857138
dependencies:
70867139
brace-expansion "^2.0.1"
70877140

7141+
minimist@^1.2.6:
7142+
version "1.2.8"
7143+
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c"
7144+
integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==
7145+
70887146
"minipass@^5.0.0 || ^6.0.2 || ^7.0.0", minipass@^7.1.2:
70897147
version "7.1.2"
70907148
resolved "https://registry.yarnpkg.com/minipass/-/minipass-7.1.2.tgz#93a9626ce5e5e66bd4db86849e7515e92340a707"
@@ -7297,7 +7355,7 @@ open@^6.2.0:
72977355
dependencies:
72987356
is-wsl "^1.1.0"
72997357

7300-
open@^7.0.3:
7358+
open@^7.0.3, open@^7.4.2:
73017359
version "7.4.2"
73027360
resolved "https://registry.yarnpkg.com/open/-/open-7.4.2.tgz#b8147e26dcf3e426316c730089fd71edd29c2321"
73037361
integrity sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==
@@ -7409,6 +7467,26 @@ parseurl@~1.3.3:
74097467
resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4"
74107468
integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==
74117469

7470+
patch-package@^8.0.1:
7471+
version "8.0.1"
7472+
resolved "https://registry.yarnpkg.com/patch-package/-/patch-package-8.0.1.tgz#79d02f953f711e06d1f8949c8a13e5d3d7ba1a60"
7473+
integrity sha512-VsKRIA8f5uqHQ7NGhwIna6Bx6D9s/1iXlA1hthBVBEbkq+t4kXD0HHt+rJhf/Z+Ci0F/HCB2hvn0qLdLG+Qxlw==
7474+
dependencies:
7475+
"@yarnpkg/lockfile" "^1.1.0"
7476+
chalk "^4.1.2"
7477+
ci-info "^3.7.0"
7478+
cross-spawn "^7.0.3"
7479+
find-yarn-workspace-root "^2.0.0"
7480+
fs-extra "^10.0.0"
7481+
json-stable-stringify "^1.0.2"
7482+
klaw-sync "^6.0.0"
7483+
minimist "^1.2.6"
7484+
open "^7.4.2"
7485+
semver "^7.5.3"
7486+
slash "^2.0.0"
7487+
tmp "^0.2.4"
7488+
yaml "^2.2.2"
7489+
74127490
path-exists@^4.0.0:
74137491
version "4.0.0"
74147492
resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3"
@@ -7487,6 +7565,11 @@ possible-typed-array-names@^1.0.0:
74877565
resolved "https://registry.yarnpkg.com/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz#93e3582bc0e5426586d9d07b79ee40fc841de4ae"
74887566
integrity sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==
74897567

7568+
postinstall-postinstall@^2.1.0:
7569+
version "2.1.0"
7570+
resolved "https://registry.yarnpkg.com/postinstall-postinstall/-/postinstall-postinstall-2.1.0.tgz#4f7f77441ef539d1512c40bd04c71b06a4704ca3"
7571+
integrity sha512-7hQX6ZlZXIoRiWNrbMQaLzUUfH+sSx39u8EJ9HYuDc1kLo9IXKWjM5RSquZN1ad5GnH8CGFM78fsAAQi3OKEEQ==
7572+
74907573
prelude-ls@^1.2.1:
74917574
version "1.2.1"
74927575
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396"
@@ -8279,6 +8362,11 @@ sisteransi@^1.0.5:
82798362
resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed"
82808363
integrity sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==
82818364

8365+
slash@^2.0.0:
8366+
version "2.0.0"
8367+
resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44"
8368+
integrity sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==
8369+
82828370
slash@^3.0.0:
82838371
version "3.0.0"
82848372
resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634"
@@ -8625,6 +8713,11 @@ throat@^5.0.0:
86258713
resolved "https://registry.yarnpkg.com/throat/-/throat-5.0.0.tgz#c5199235803aad18754a667d659b5e72ce16764b"
86268714
integrity sha512-fcwX4mndzpLQKBS1DVYhGAcYaYt7vsHNIvQV+WXMvnow5cgjPphq5CaayLaGsjRdSCKZFNGt7/GYAuXaNOiYCA==
86278715

8716+
tmp@^0.2.4:
8717+
version "0.2.5"
8718+
resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.2.5.tgz#b06bcd23f0f3c8357b426891726d16015abfd8f8"
8719+
integrity sha512-voyz6MApa1rQGUxT3E+BK7/ROe8itEx7vD8/HEvt4xwXucvQ5G5oeEiHkmHZJuBO21RpOf+YYm9MOivj709jow==
8720+
86288721
tmpl@1.0.5:
86298722
version "1.0.5"
86308723
resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.5.tgz#8683e0b902bb9c20c4f726e3c0b69f36518c07cc"
@@ -8811,6 +8904,11 @@ universalify@^0.1.0:
88118904
resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66"
88128905
integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==
88138906

8907+
universalify@^2.0.0:
8908+
version "2.0.1"
8909+
resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.1.tgz#168efc2180964e6386d061e094df61afe239b18d"
8910+
integrity sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==
8911+
88148912
unpipe@1.0.0, unpipe@~1.0.0:
88158913
version "1.0.0"
88168914
resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec"
@@ -9129,6 +9227,11 @@ yaml@^2.2.1:
91299227
resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.7.0.tgz#aef9bb617a64c937a9a748803786ad8d3ffe1e98"
91309228
integrity sha512-+hSoy/QHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA==
91319229

9230+
yaml@^2.2.2:
9231+
version "2.9.0"
9232+
resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.9.0.tgz#78274afd93598a1dfdd6130df6a566defcbf9aa4"
9233+
integrity sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA==
9234+
91329235
yargs-parser@^18.1.2:
91339236
version "18.1.3"
91349237
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.3.tgz#be68c4975c6b2abf469236b0c870362fab09a7b0"

package/src/components/MessageList/MessageFlashList.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,7 @@ const MessageFlashListWithContext = (props: MessageFlashListPropsWithContext) =>
395395
return;
396396
}
397397

398+
console.log('[STREAM] scrollToEnd effect#1 (autoscrollToRecent) fired');
398399
flashListRef.current.scrollToEnd({
399400
animated: true,
400401
});
@@ -432,7 +433,7 @@ const MessageFlashListWithContext = (props: MessageFlashListPropsWithContext) =>
432433
if (indexOfParentInMessageList === -1) {
433434
loadChannelAroundMessage({ messageId: targetedMessage, setTargetedMessage });
434435
} else {
435-
scrollToDebounceTimeoutRef.current = setTimeout(() => {
436+
scrollToDebounceTimeoutRef.current = setTimeout(async () => {
436437
clearTimeout(scrollToDebounceTimeoutRef.current);
437438

438439
const scrollToIndex = async () => {
@@ -451,12 +452,10 @@ const MessageFlashListWithContext = (props: MessageFlashListPropsWithContext) =>
451452
return true;
452453
};
453454

455+
await scrollToIndex();
454456
requestAnimationFrame(async () => {
455457
await scrollToIndex();
456-
requestAnimationFrame(async () => {
457-
await scrollToIndex();
458-
setTargetedMessage(undefined);
459-
});
458+
setTargetedMessage(undefined);
460459
});
461460
}, WAIT_FOR_SCROLL_TIMEOUT);
462461
}

0 commit comments

Comments
 (0)