-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
Conditional on VirtualScroll causes no content to be displayed in any case #9655
Comments
Having a similar issue although it was working for me back as recent as |
Well, I skipped rc3, hence why I only now saw it. |
VirtualScroll with InfiniteScroll is more unreliable in RC 4 than it was in RC 3. It sometimes display images and sometimes it doesn't. When InfiniteScroll loads the contents, VirtualScroll clears all contents from the screen, and just displays white area. If we try to touch and scroll white area (up or down) it triggers InfiniteScroll and send request to server to fetch next page's record.. |
This issue appears for me with |
I'm having the same issue. |
virtualScroll does not work in segments in RC5. As stated above [ngSwitch] is used as a conditional to change the content for the different segments. The first shown segment when entering a page will display correctly, as soon as you navigate to another segment it's just a white page with no content shown. |
#7734 - is related to this issue. I have done a little troubleshooting and found something that might help the team to fix this: attached are 2 screenshots, the first working.png is when I first enter a page that has a virtualscroll list inside a segment. On that first load the segment shows the content correctly. the second second screenshot shows when I navigate to a different segment and then come back to the original one. It is now showing a blank white page instead of the list. I can see that all of the list items are present in the DOM. There is a clear issue with the CSS though: working list has .virtual-scroll class with position: relative seems like when there is a conditional virtual-scroll gets stuck in it's loading state and never transitions to being visible. |
seems that when a conditional is in use this._init is not set so ngDoCheck() doesn't run and hence the virtualScroll list gets stuck in loading state. If I edit the virtualScroll component and just remove this._init from the if statement in ngDoCheck() then the virtualScroll list is properly rendered when inside a conditional, although it does "pop" in as a result of this change. ngDoCheck() { |
I'm upgrading from |
This is indeed still an issue for me in 2.0.0 final virtualscroll does not work inside ngSwitchCase |
@jgw96 - for a final release there are still some really big bugs with virtualscroll, could they please get some attention? Working with conditionals / segments is a key one, otherwise use cases are really limited. |
This is still an issue more than 6 months after the bug was first raised. |
fixed! 88b2e83 |
@manucorporat: The problem seems to be that VirtualScroll isn't initialized because it listens to |
I still have this issue with 3.9.2. I cannot toggle between two virtualScroll lists that are built from the same array that are inside *ngIf |
I opened a PR #13406 which should fix the problem here. Please try it and tell me if it's working :) |
Is there a status update on this please? |
@ryanhalley I made a PR #13406 but it's not merged yet. You can build ionic-angular by your own if you want, or download my build on my PR and replace it in your |
I made an update of my build as there was an unhandled edge case when VS is recreated after being destroyed... You can find it here: #13406 |
fixed: setTimeout(() => { |
to get around this I change around the virtualScroll's inputted array values ex. |
@442623641 Nice one! I just put this into a "refreshVirtualScroll" function and call it when the conditional changes and all behaves more like it should. I dropped the timeout values down to 100 as well and still all looks good with a much less noticeable delay. Hopefully this is no longer needed when ionic v4 arrives or the PR above gets merged for V3 so this isn't even needed any more. For now though I can finally use virtualscroll inside a conditional. |
A quick fix for now -
|
Can confirm that this bug still exists on Ionic Framework Version 3.9.2. Sadly, PR #13406 wasn't merged into master, because of significant master changes introduced by the porting of all of the Ionic components to web components... @HugoHeneault |
@benjhess My PR should work on 3.9.2, and it won't be merged through the 3.9 base. There are some quick fix working well without having to rebuild ionic. I haven't checked the new v4 virtualscroll yet... |
What is this "this.cdRef" ?? |
Change detection reference |
cdRef is ChangeDetectorRef |
This issue has been automatically identified as an Ionic 3 issue. We recently moved Ionic 3 to its own repository. I am moving this issue to the repository for Ionic 3. Please track this issue over there. If I've made a mistake, and if this issue is still relevant to Ionic 4, please let the Ionic Framework team know! Thank you for using Ionic! |
Issue moved to: ionic-team/ionic-v3#147 |
Ionic version: (check one with "x")
[ ] 1.x
[X] 2.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:
Conditional on VirtualScroll causes no content to be displayed, even if there should be content. This is on rc4.
Expected behavior:
If there's a conditional, it should still work if the condition returns true. It used to work like this on rc2.
Related code:
html:
ts:
Other information:
If I take the same code and take out the *ngIf="dataStorage", it displays correctly.
Ionic info: (run
ionic info
from a terminal/cmd prompt and paste output below):The text was updated successfully, but these errors were encountered: