You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm implementing a chat UI anchoring to the bottom. The height of the chat messages can increase when rendering due to dynamic content such as images/video and markdown content that is rendered async.
I've noticed that when paddingEnd is larger than scrollEndThreshold, then the chat doesn't stay anchored to the bottom as the final item expands in height. It tracks it for a while, but then stops.
Is there some approach I should use to update the virtualiser?
constvirtualizer=useVirtualizer({anchorTo: 'end',directDomUpdates: true,followOnAppend: 'instant',// when this larger than `scrollEndThreshold` the scroll to bottom gets out of syncpaddingEnd: 120,scrollEndThreshold: 80,count: rows.length,estimateSize: ()=>72,getItemKey: (index)=>rows[index]?.id??`missing-${index}`,getScrollElement: ()=>scrollRef.current,});
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm implementing a chat UI anchoring to the bottom. The height of the chat messages can increase when rendering due to dynamic content such as images/video and markdown content that is rendered async.
I've noticed that when
paddingEndis larger thanscrollEndThreshold, then the chat doesn't stay anchored to the bottom as the final item expands in height. It tracks it for a while, but then stops.I have a minimal repro here.
Is there some approach I should use to update the virtualiser?
Beta Was this translation helpful? Give feedback.
All reactions