Repository navigation
fix: Fix broken pointer scroll in virtual lists in certain situations - #5124
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5124 +/- ##
=======================================
Coverage 97.70% 97.71%
=======================================
Files 990 991 +1
Lines 31818 31838 +20
Branches 11752 11758 +6
=======================================
+ Hits 31089 31109 +20
+ Misses 722 683 -39
- Partials 7 46 +39 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
avinashbot
force-pushed
the
virtual-list-broken-scroll
branch
from
October 8, 2026 16:18
d7567f0 to
792a0af
Compare
avinashbot
force-pushed
the
virtual-list-broken-scroll
branch
from
October 9, 2026 05:55
792a0af to
f2bcfdd
Compare
avinashbot
marked this pull request as ready for review
October 9, 2026 06:22
gethinwebster
approved these changes
Oct 9, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
See ticket for repro and video. It's pretty easy to reproduce but hard to do by accident (open the thing with the keyboard and scroll with your mouse without moving your cursor). Turns out, it's because the return value of
useVirtualisn't stable between renders, so we got accidental rerenders, andscrollToIndexgot called unintentionally. Fixed it by only usingscrollToIndex(made stable) inside the useEffect.Related links, issue #, if available: AWSUI-62335
How has this been tested?
Tested in a dev page, verified that it works once I switch to the new implementation. Kiro wrote me some unit tests, but they were complex and mocked basically everything since JSDOM doesn't support a lot of measurement stuff. So integ tests it is (also written by Kiro).
Review checklist
The following items are to be evaluated by the author(s) and the reviewer(s).
Correctness
CONTRIBUTING.md.CONTRIBUTING.md.Security
checkSafeUrlfunction.Testing
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.