kamilkp / angular-vs-repeat

Virtual Scroll for AngularJS ngRepeat directive
http://kamilkp.github.io/angular-vs-repeat/
MIT License
818 stars 228 forks source link

Viewport display only one element on page load and display rest of the elements when a scroll is triggered #192

Open harshpuidev opened 6 years ago

harshpuidev commented 6 years ago

I have used vs-repeat at multiple places and now i see only 1st element out of thousand.

In a viewport, i can display about 15 elements but currently, i see only one and then when I trigger a scroll it displays all elements. I am using angular 1.5.9

kamilkp commented 6 years ago

Can you come up with a minimal example app in a jsfiddle?

Kamil Pękala

Wiadomość napisana przez harshpuidev notifications@github.com w dniu 19.03.2018, o godz. 18:41:

I have used vs-repeat at multiple places and now i see only 1st element out of thousand.

In a viewport, i can display about 15 elements but currently, i see only one and then when I trigger a scroll it displays all elements. I am using angular 1.5.9

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

mikemahony commented 6 years ago

I'm experiencing the same bug. For me, the issue arises when the list I'm repeating over changes but I'm unable to re-create the exact issue in jsFiddle. I am however able to recreate the same outcome by triggering a resize: https://jsfiddle.net/L5t4wdfk/

Senderek commented 6 years ago

Same bug for me, when creating a big table with many binds and with scroll bound to 'window' on initial render I get only first row. The plugin is working properly after scrolling down a bit though. As an additional note I can say that vs-repeat is in tbody element

squidsoup commented 6 years ago

Has anyone managed to find a workaround for this? This appears to be a regression. We upgraded from v1.1.7 to v2.0.9 and have the same issue.

Ulyssesyi commented 6 years ago

I got the same problem and solve it by the options. image

alejandroiglesias commented 5 years ago

I've also stumbled upon this issue and manually setting the size as @Ulyssesyi suggested has worked as a workaround. I would still like to see the root cause solved since I would prefer not to set a fixed size on the elements since size can vary anytime through CSS and forgetting to update the size in the vs-repeat directive would mean breaking the list scrolling (and it's easy to forget that).

hugoj-goncalves commented 5 years ago

I don't know about a workaround, but this seems to fix. https://github.com/kamilkp/angular-vs-repeat/pull/224

thao33 commented 4 years ago

@hugoj-goncalves Thanks a lot. facing the same problem..

Hope that commit will be merged soon !!!!!