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

VirtualScroll elements disappear to early from the view #13772

Closed
zk118 opened this issue Jan 5, 2018 · 11 comments
Closed

VirtualScroll elements disappear to early from the view #13772

zk118 opened this issue Jan 5, 2018 · 11 comments

Comments

@zk118
Copy link

zk118 commented Jan 5, 2018

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

I'm submitting a ...
[X] bug report

Current behavior:
Hi, since I upgraded from ionic 2.2.1 to the latest 3.9.2 i have an issue with the VirtualScroll.

Here is the start page (there is a toolbar in header):
GitHub Logo

When i start scroll to the bottom (everything is fine):
GitHub Logo

When i scroll a bit more, the first element of the list disappear to early and we can see a huge blank space which is awful. It should disappear when the first element is almost visible on the top. :
GitHub Logo

When I delete the toolbar in the header it fixes the issue so I think the Virtual scroll doesn't understand that there is this gap between the top of screen and the start of the virtual scroll. How can I tell him that this gap exists?
GitHub Logo

It happens on both serve and devices.
It happens not only on the first element of list but on all the elements.

Expected behavior:
The first visible element should disappear when it is almost visible on the top.

Related code:

 <ion-list [virtualScroll]="feed.posts" approxItemHeight="225px"  no-lines>
    <div class="feed-item" *virtualItem="let post" style="width: 100%">
       <ion-card> ... </ion-card>
    </div>
 </ion-list>

Ionic info:

Cordova CLI: 8.0.0 
Ionic Framework Version: 3.9.2
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 3.1.7
ios-deploy version: 1.9.2 
ios-sim version: 6.1.2 
OS: macOS Sierra
Node Version: v9.3.0
Xcode version: Xcode 9.2 Build version 9C40b
@kensodemann
Copy link
Member

Hello! Thank you for opening an issue with us! Would you be able to provide a sample application via GitHub that demonstrates the issue you are having? Thanks for using Ionic!

@kensodemann
Copy link
Member

Hello! As it seems it has been a while since there was any activity on this issue I am closing it for now. If you are still having the issue, please be sure to include a GitHub repo with a sample application.

Thanks for using Ionic!

@daveshirman
Copy link

daveshirman commented Jan 16, 2018 via email

@newHagen
Copy link

newHagen commented Feb 6, 2018

I just noticed the exact same issue.

As soon as there is any content above the virtualScroll area, the virtualItems start to disappear while they are still visible. The offset seems to match the height of the content before the virtualScroll starts, which might result in scrolling through pages without any content.

@zk118
Copy link
Author

zk118 commented Feb 6, 2018

@BitEater

Yeah, the only workaround I found was to put the toolbar in the header and not in the content (so it is visible even on scroll).

@newHagen
Copy link

newHagen commented Feb 6, 2018

@evenmind Yes, that worked for me too. But this does not solve the issue if you have additional content - like featured posts, etc. - above the list of scrolling items. And this bug is limits you in the layout of your UI-features.

@zk118
Copy link
Author

zk118 commented Feb 6, 2018

Yes it's really annoying !

@daveshirman
Copy link

daveshirman commented Feb 6, 2018 via email

@zk118
Copy link
Author

zk118 commented Feb 6, 2018

@daveshirman The problem is I have a huge liste of 1000 elements, each one have an image so if I don't use the virtual scroll and load elements by 10 for exemple with an infinite scroll, if scrolled to the bottom the DOM can't support rendering 1000 elements so I have no choices. Except if you have an idea for this?

@daveshirman
Copy link

daveshirman commented Feb 7, 2018

maybe the suggestion here: #11542 by @RafaelKr

@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