Replies: 8 comments
-
Hi, could you make a minimal reproduction? |
Beta Was this translation helpful? Give feedback.
-
Hi @inokawa I've created an isolated electron app that's as close as possible to how the actual app functions. If possible, I'd like to share it privately. Could you let me know how I could do so? |
Beta Was this translation helpful? Give feedback.
-
I want to chime in and say I've also been experiencing this, and I have some theories on what's causing it. When I trip the loader to load more, the load happens but the scroll has continued to move up during that same period (inertial scrolling?). Because I'm only appending 25 items to the head of the list, the visible range is immediately put back into the "go get more to load" state due to the upward momentum. I have a really weird fix where i basically timeout the ability to load more for 1.5s, and after a mutation and a @mrooding i think maybe you could be experiencing the same thing? |
Beta Was this translation helpful? Give feedback.
-
@WalrusSoup that's interesting. Even without this bug I noticed that the range change event handler was firing very often so I already introduced a debounce function. That didn't seem to fix it for me though. Possible, manually moving the scroll position would fix it like you did. Would you be able to share an isolated example of your solution? @inokawa @WalrusSoup I've stripped the example app to the bare minimum of what my overall setup looks like: https://drive.google.com/file/d/1RiToR4mq0iitkQKbbg6vQ_DdDy7ubGEi/view?usp=sharing To reproduce:
|
Beta Was this translation helpful? Give feedback.
-
Thanks! I'll take a look. |
Beta Was this translation helpful? Give feedback.
-
Your application logic fetches new items in onRangeChange callback. Prepending items will change visible range so onRangeChange can be called infinitely if we don't have proper guard. So please consider adding guard. |
Beta Was this translation helpful? Give feedback.
-
@inokawa thank you for the reply. What would a proper guard look like to you? |
Beta Was this translation helpful? Give feedback.
-
Hi @inokawa I'd appreciate your input on this one. Thanks again |
Beta Was this translation helpful? Give feedback.
-
Describe the bug
When using a Virtualizer with a list index component to jump to a specific point within the list, scrolling upwards really quickly after loading makes the scrollbar jitter. It continuously calls range change event handler until it reaches start index 0.
To Reproduce
Video: https://photos.app.goo.gl/j9SXEJGUyirVuCyY7
Expected behavior
It should just load the previous items once and not loop all the way back to 0
Platform:
Additional context
I'm trying to implement a virtual list that supports a list index component used for jumping to a specific index. Regular horizontal scrolling from the start of the list until the end works perfect.
After using the list index to jump to a specific offset, scrolling downwards to load higher index items works fine too. However, when scrolling upwards extremely fast seems to create a state where the scrollbar is stuck and a update loop is triggered which loads all the items until index 0 is reached.
I've tried using a normal
VList
instead of a Virtualizer (with scroll-ref) but that had the same effect. I've based my implementation on the feed exampleSimplified usage of the component:
Beta Was this translation helpful? Give feedback.
All reactions