Skip to content
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

Virtual scroll does not work in an empty conditional element #12565

Closed
Remco75 opened this issue Aug 3, 2017 · 11 comments
Closed

Virtual scroll does not work in an empty conditional element #12565

Remco75 opened this issue Aug 3, 2017 · 11 comments

Comments

@Remco75
Copy link

Remco75 commented Aug 3, 2017

Ionic version: (check one with "x")
[ ] 1.x (For Ionic 1.x issues, please use https://github.com/ionic-team/ionic-v1)
[ ] 2.x
[x ] 3.x

I'm submitting a ... (check one with "x")
[ X] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/

Current behavior:
When using virtualScroll in a element that renders on condition (among others *ngIf) and the element is completely empty (besides the virtual scroll elements) the list will not render. Putting in anything inside the div will make it appear (even a   will do)
Expected behavior:
It renders always

Steps to reproduce:
http://plnkr.co/edit/zJSEfkUWb2c1GzxTXKDV?p=preview

Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):
version 3.6.0

@Remco75
Copy link
Author

Remco75 commented Aug 3, 2017

hmm, the behaviour is a bit ore weird: it needs a change-detection cycle to kick in it seems. So scrolling back and forth in the plucker makes the content appear

@Remco75
Copy link
Author

Remco75 commented Aug 3, 2017

also in more complex situation (like nesting a ngIf inside a ngSwitchCase which contains a list, i can not get the list to show up

@Ozzyris
Copy link

Ozzyris commented Aug 4, 2017

I'm experiencing the same issue. @Remco75 if you found a stable solution, I am very interested.

@Remco75
Copy link
Author

Remco75 commented Aug 4, 2017

@Ozzyris nope, atm I can not use vritualscroll in my usecase. I hope someone has a suggestion ( or better yet, a fix ;-))

@Ozzyris
Copy link

Ozzyris commented Aug 4, 2017

I found a fix to make it work in my case, by replacing "*ngIf=" by "[hidden]=" ! Hope that can help.

@Remco75
Copy link
Author

Remco75 commented Aug 4, 2017

Cool Will try that. But the whole point of virtual scroll is to be as cheap as possible.... That's why the if, to render less, with the least amount of bindings.. so still I think this needs a fix

@Ozzyris
Copy link

Ozzyris commented Aug 4, 2017

Yes you are right, let's just say that's can be a quick fix until we have a proper one.

@jgw96
Copy link
Contributor

jgw96 commented Aug 4, 2017

Hello all! I am going to close this issue as a duplicate of #9655. Thanks!

@jgw96 jgw96 closed this as completed Aug 4, 2017
@Remco75
Copy link
Author

Remco75 commented Aug 5, 2017

@jgw96 sorry, missed the double. But that has been open for a long time. Is there any change it will be resolved any time soon?

@Wiki1991
Copy link

Wiki1991 commented Nov 8, 2017

"[ngClass]='{'hide':!data}'" replace "*ngIf" it works for me

@ionitron-bot
Copy link

ionitron-bot bot commented Sep 1, 2018

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants