-
-
Notifications
You must be signed in to change notification settings - Fork 98
Open
Labels
Description
Describe the bug
It seems using .scrollToIndex sometimes doesn't work, unfortunately I can't provide an example as I'm not be able to reproduce it, it only happens occasionally.
To Reproduce
virtualizer.scrollToIndex(messages.length - 1, {
align: 'start',
})
Expected behavior
scroll to the given index
Additional context
using it with requestAnimationFrame or settimeout seems to fix the issue:
requestAnimationFrame(() =>
virtualizer.scrollToIndex(messages.length - 1, {
align: 'start',
})
)
p.s. I don't think it's an timing issue, as I'm using an effect which solely has messages as dependency, so the index should be correct.
Reactions are currently unavailable