Replies: 5 comments
-
Hello @Razum , const ref = useRef(null);
<VList
ref={ref}
onScroll={(offset)=> {
if (offset < 100) return ref.current.dontFixChildrenPosition();
ref.current.fixChildrenPosition()
}}
> |
Beta Was this translation helpful? Give feedback.
-
The main idea was to add a new method here. If we add new elements to |
Beta Was this translation helpful? Give feedback.
-
Thanks, I understood. I think recalculate like method will not be suitable for virtua because of its architecture, but the idea is helpful. I'll try to think this hard problem again. |
Beta Was this translation helpful? Give feedback.
-
The point is that virtua have to know where the items are removed from/added to, before modifying DOM on next render. Currently |
Beta Was this translation helpful? Give feedback.
-
I would consider not just a flexible component that easily adapts to passed properties and flags, but rather a component that operates in different modes: standard and reverse. In standard mode, it would be , and in reverse mode, . Each mode operates with different strategies for size, offsets, and scroll calculations, as there are too many differences between them, but they use the same cache. Under the hood, these could be different Virtualizers. |
Beta Was this translation helpful? Give feedback.
-
Hi @inokawa!
First of all, thank you for creating such a wonderful component.
I'm currently facing the same issue mentioned by @mattwondra here.
I've noticed that triggering a resize causes Vlist to recalculate its children's positions and fixes the layout. Since the shift issue seems to be more complex and requires significant effort, is it possible to add a recalculate handler to the VList?
Thanks in advance!
cc @LookRain
Beta Was this translation helpful? Give feedback.
All reactions