Skip to content

Virtual Scroll- Combination of Scrolling and Filtering Results in Empty Nodes #13392

@bparvizi

Description

@bparvizi

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

  1. Start app.
  2. Scroll all the way down to item 100.
  3. Make sure scrolling is at a complete stop.
  4. Click on the segment tab, “Filter 5”, in the footer to filter the virtual scroll list down to 5 items.
  5. Make sure scrolling is at a complete stop.
  6. Click on the segment tab, “All 100”, in the footer to filter the virtual scroll back to 100 items.
  7. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions