Replies: 8 comments 4 replies
-
@piecyk I'll work on a sandbox, but I have a couple questions about your implementation I want to make sure I understand. I see that you're adjusting the scrollOffset when new items are fetched using: const nextOffset =
virtualizerRef.current.scrollOffset + pageSize * itemSize;
virtualizerRef.current.scrollOffset = nextOffset;
virtualizerRef.current.calculateRange();
virtualizerRef.current.scrollToOffset(nextOffset, { align: "start" }); For the pageSize * itemSize calculation, this seems very dependent upone knowing the item size. Or at least having a very good estimate. What about cases where the items can be very different sizes? Wont this cause scroll issues? What does Originally posted by @lexahall in #400 (comment) |
Beta Was this translation helpful? Give feedback.
-
Makes sense, thanks!
Technically the data, but it's a little funky in my case. Basically we will have fetched the most recent message for each chat before you even enter the chat. Meaning that when you enter, exactly 1 piece of data is loaded, then the page loads, and as the page loads, we fetch the first "page" of chat history (which is up to the last 100 messages).
We do an optimistic update, then get the updated data from the server when it's available. |
Beta Was this translation helpful? Give feedback.
-
anything new on this |
Beta Was this translation helpful? Give feedback.
-
Love tanstack and react-virtual, but looks like this is still in progress, if anyone else here needs an alternative in the meantime - react-virtuoso seems to be one of the few virtualized libraries that does support this: |
Beta Was this translation helpful? Give feedback.
-
When this can be merged? |
Beta Was this translation helpful? Give feedback.
-
please merge this feature |
Beta Was this translation helpful? Give feedback.
-
Love react-virtual,Has anyone successfully used it in cases like chat? |
Beta Was this translation helpful? Give feedback.
-
example with chat-like layout #195 (comment) |
Beta Was this translation helpful? Give feedback.
-
Let's start conversion about implementation guidelines.
Beta Was this translation helpful? Give feedback.
All reactions