-
Notifications
You must be signed in to change notification settings - Fork 24.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix items disappear when zooming VirtualizedList #33765
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks for this improvement.
@@ -47,6 +47,7 @@ type Context = $ReadOnly<{ | |||
timestamp: number, | |||
velocity: number, | |||
visibleLength: number, | |||
... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not add zoomScale: number
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
@yungsters has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The VirtualizedList-test.js
Jest test seems to be failing after this change. Specifically, the "keeps sticky headers above viewport visualized" test is failing. Can you take a look?
@@ -25,12 +25,13 @@ export function elementsThatOverlapOffsets( | |||
offset: number, | |||
... | |||
}, | |||
zoomScale: number, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This requires calls in VirtualizeUtils-test.js
to be updated. Otherwise, the Jest test fails.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed so that the test passes.
@yungsters has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
This pull request was successfully merged by @islandryu in 13a72e0. When will my fix make it into a release? | Upcoming Releases |
Summary
fix #33705
Fixed the disappearance of items when scrolling after zooming VirtualizedList.
example https://github.com/islandryu/zoomVirtualizedList
Before modification
2022-05-05.9.23.40.mov
After modification
2022-05-05.14.42.05.mov
Changelog
[General] [Fixed] - Fixed the disappearance of items when scrolling after zooming VirtualizedList.
Test Plan
Make the VirtualizedList zoomable with a prop such as maximumZoomScale.
Apply the patch and make sure that items in the VirtualizedList do not disappear when you scroll after zooming the VirtualizedList.
Or apply the patch from this repository and check it.
https://github.com/islandryu/zoomVirtualizedList