Repository navigation
fix(virtual-scroll): wrong item top calculation and visibility propagation - #17345
Merged
Merged
Conversation
DavidWiesner
force-pushed
the
issue-15948
branch
from
February 4, 2019 05:23
d11069f to
827cfb2
Compare
6 of 20 tasks
Contributor
Author
|
You guys did a great job by rewriting virtual scroll. Both issues solved in this pr are important to fix. My company spend a lot of effort to port our three apps to ionic 4. Is there any reason why this pr will not get merged? What I can help to get this merged? Should I write another unittest or add a new unittest instead of replacing the old? Thx |
Contributor
Author
|
I add some more details about the causes of the issues. To help the reviewers understanding my changes. |
liamdebeasi
approved these changes
Mar 19, 2019
liamdebeasi
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the PR! 🎉
brandyscarney
approved these changes
Mar 26, 2019
Member
|
Thanks @DavidWiesner! I'm going to release a dev build and I'll add it to those issues for testing. |
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.
Short description of what this resolves:
In the
updateVDoma wrong index was used to set cellstopposition. This is only problematic when aheaderFnorfooterFnis provided.I extended a unittest that will fail in the latest ionic version and describe this problem
https://github.com/ionic-team/ionic/blob/6603a3fe31c8b7a6dad36eac4a1b9ba849fa8ebd/core/src/components/virtual-scroll/test/virtual-scroll-utils.spec.ts#L367-L386
Detailed issue cause:
In
virtual-scroll-utils.ts#L239you are usingias overall index (including header and footer) but invirtual-scroll-utils.ts#L49you are using the raw item index (excluding header and footer).Also if the
approxHeaderHeightperfectly matches the calculated height of the node, the visibility of the cell was not propagated to the dom.In
virtual-scroll.tsx#L330you update the visibility of the item, but this update will only scheduled, when the height is different to the previous known height.Changes proposed in this pull request:
updateVDomto update thetoptransition ()topis also calculated right with a givenheaderFnandfooterFnapproxHeaderHeight/approxFooterHeightmatches the calculated heightIonic Version:
4.0.2
Fixes: #15948, #17298