-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Description
Ionic version: (check one with "x")
(For Ionic 1.x issues, please use https://github.com/ionic-team/ionic-v1)
[ ] 2.x
[ ] 3.x
[x] 4.x
I'm submitting a ... (check one with "x")
[ x] bug report
[ ] feature request
Current behavior:
Combination of scrolling and filtering results in empty nodes when using the virtual scroll component.
Expected behavior:
Combination of scrolling and filtering should not result in empty nodes when using the virtual scroll component.
Steps to reproduce:
Please follow the following steps using the sample app on Github, https://github.com/bparvizi/virtual-scroll-render-bug. Recording of the issue can also be viewed on YouTube, https://youtu.be/q50TSKBhBxE
- Start app.
- Scroll all the way down to item 100.
- Make sure scrolling is at a complete stop.
- Click on the segment tab, “Filter 5”, in the footer to filter the virtual scroll list down to 5 items.
- Make sure scrolling is at a complete stop.
- Click on the segment tab, “All 100”, in the footer to filter the virtual scroll back to 100 items.
- Notice nodes display empty. This is reproducible both on iOS and in Chrome on the desktop,
Examined the markup and the nodes are present when the virtual scroll displays blank, however, the y position does not get updated and remains to be set to values way down the list. For example, the style tag that sets the transform property will have large y values (2394px):
style="transform: translate3d(0px, 2394px, 0px);"
The nodes are not updated to reflect new y values set to the top like 0px, 126px, etc until the user manually scrolls again. Our app uses cell heights of 80px which appears to really show the issue as seen here.
Related code:
Sample app made available on Github, https://github.com/bparvizi/virtual-scroll-render-bug