-
Notifications
You must be signed in to change notification settings - Fork 167
[WIP] Support animation #2
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
Conversation
This pull request is automatically deployed with Now. Latest deployment for this branch: https://rc-virtual-list-git-animation.react-component.now.sh |
Codecov Report
@@ Coverage Diff @@
## master #2 +/- ##
=========================================
+ Coverage 0% 14.6% +14.6%
=========================================
Files 3 4 +1
Lines 71 226 +155
Branches 12 46 +34
=========================================
+ Hits 0 33 +33
- Misses 71 192 +121
- Partials 0 1 +1
Continue to review full report at Codecov.
|
cc @afc163 Please help to check on this. |
We use class component here since typescript can not support generic in function component
Virtual list display logic:
scrollTop
margin-top
to fit the positionAlgorithm
We split scroll bar into equal slice. An item with whatever height occupy the same range slice.
When
scrollTop
change, it will calculate the item percentage position and move item to the position.Then calculate other item position base on the located item.
Concept
located item
The base position item which other items position calculate base on.