vue-virtual-scroller icon indicating copy to clipboard operation
vue-virtual-scroller copied to clipboard

Question / Help With Debugging

Open codingJWilliams opened this issue 5 years ago • 9 comments

Hello, I am trying to use a page-mode scroller but it simply does not load the items. I have attached my Vue classes & GIFs

page-mode=true

Vue class file: https://paste.voidcrafted.me/iwuxituceh.vue Behaviour: https://i.jay.network/TSewhD.gif

page-mode=false (& relevant css)

Vue class file: https://paste.voidcrafted.me/uqowudahaj.vue Behaviour: https://i.jay.network/2xnpDi.gif

codingJWilliams avatar Apr 24 '20 01:04 codingJWilliams

Hmm, interesting, it was breaking because it was inside an element with overflow-x: hidden - https://i.jay.network/4RY0E2.png

Maybe still a bug that needs to be looked into?

codingJWilliams avatar Apr 24 '20 01:04 codingJWilliams

Same issue. Also, when resizing the window, items inside the scroller rerender normally.

tarik02 avatar Apr 30 '20 18:04 tarik02

I found the cause of the issue.

Look at this line: https://github.com/Akryum/vue-virtual-scroller/blob/master/src/components/RecycleScroller.vue#L493

This function returns DOM node scroll event listener should be attached do. So, it uses this package: https://github.com/olahol/scrollparent.js, which finds nearest parent having overflow(-x, -y) at least one with value auto or scroll. You can try to do it yourself (or calling that library) settings overflow to hidden (or removing it at all) from all such parents.

Now, a question to @Akryum. Should the library really look for some parent scrollable node, but not just using body? Even though, I think you should let users set this element instead of just guessing it.

tarik02 avatar Apr 30 '20 18:04 tarik02

At least, this should be mentioned in "page-mode" description.

tarik02 avatar May 01 '20 06:05 tarik02

I second @Tarik02 , spent a couple hours debugging this but discovered it was because it was wrapped by overflow-x: none. This should be mentioned in the description of page-mode to save someone, somewhere, some time.

allynsweet avatar Jun 09 '21 20:06 allynsweet

Hello good evening, I also encounter this issue, just want to ask how did you solve this issue ?

m-val avatar Sep 15 '21 12:09 m-val

Hey! Sorry, this issue was a while ago and I don't remember how I solved it, and unfortunately the image is no longer on my CDN.

Sorry I couldn't help

codingJWilliams avatar Sep 15 '21 12:09 codingJWilliams

Hi, it's ok no worries thank you. but if you manage to remember on how to solve it, do let me know. Thank you.

m-val avatar Sep 15 '21 12:09 m-val

@m-val Without seeing any code, it would be hard to tell what the issue is. But it seems the root cause of the issue is with the overflow-x CSS attribute. Check your code to make sure you're not wrapping the virtual scroller in a component that uses that attribute.

allynsweet avatar Sep 15 '21 13:09 allynsweet