Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
fix(virtual-scroll): don't crash with empty cells list #17799
Short description of what this resolves:
In some conditions combining e.g. ion-infinite-scroll with ion-virtual-scroll, the cells list can be empty, meaning accessing
Changes proposed in this pull request:
Correct the line to return zero when the cell list is empty rather than throwing an error.
Ionic Version: latest.
Hi Liam, it does not fix an issue filed on GitHub, but an issue I've found in my own project. Figured it was simpler to just make a PR than both an issue and a PR.…
On Fri, Mar 22, 2019, 1:23 PM Liam DeBeasi ***@***.***> wrote: Hi there, Does this PR fix a particular issue? If so, could you add it to the PR description? Thanks! — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#17799 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AANj6FviGJSCF2218HRXVSmy7mWmU4Yuks5vZTvHgaJpZM4b2-79> .
Sure - I can probably get around to setting up a MWE repo, but it might be a couple weeks. If that's too long, I'd imagine the following would work: 1. Create a default Ionic project with any template. 2. Replace the home page with a virtual scroll with divs, based on an items list that is initially empty. 3. In ngOnInit, set a timeout for e.g. 500ms and add something to the items list in the callback.…
On Mon, Mar 25, 2019 at 6:01 AM Liam DeBeasi ***@***.***> wrote: Ok no prob. Do you have some steps to reproduce the original issue? This will help when testing out this PR. Thanks! — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#17799 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AANj6O8ZWH3ikpekwkG8PJT_F1n-mdYuks5vaMiogaJpZM4b2-79> .