Akryum / vue-virtual-scroller

⚡️ Blazing fast scrolling for any amount of data
https://vue-virtual-scroller-demo.netlify.app
9.39k stars 896 forks source link

Scroller render doesn't account for the height of leading or trailing slots #685

Closed danatcofo closed 1 year ago

danatcofo commented 2 years ago

Not sure how this is doing it under the covers but heres a video showing what I'm talking about. Screen Recording 2021-09-28 at 5 25 50 PM

Inside the #before slot we have elements that get toggle to be sticky or relative. The sticky version works fine visually where the elements disappear and are reused smoothly. The relative version treats the area as if it where sticky... i.e preserving the #before slot sizing internally.

Is there something I can do to force or tell the scoller to use the area in the #before slot as well such that it doesn't have the blank area?

danatcofo commented 2 years ago

I can reproduce this actually on the demo here https://akryum.github.io/vue-virtual-scroller/#/dynamic by setting the hight of the leading notice element to 500px in the developer tools.

So it appears that the logic doesn't account for leading height of the #before slot

danatcofo commented 2 years ago

Looks like a work-around for this bug is to set the :buffer="" to the height of the #before slot contents.

semiaddict commented 2 years ago

Seems like a duplicate of #510