ScrollableList: reset topOffset if node doesn't match
This commit is contained in:
parent
68e80aa7be
commit
36fb7fea7d
1 changed files with 2 additions and 0 deletions
|
@ -111,6 +111,8 @@ const ScrollableList = React.forwardRef<VirtuosoHandle, IScrollableList>(({
|
|||
const node = document.querySelector(`[data-virtuoso-scroller] [data-item-index="${topIndex.current}"]`);
|
||||
if (node) {
|
||||
topOffset.current = node.getBoundingClientRect().top * -1;
|
||||
} else {
|
||||
topOffset.current = 0;
|
||||
}
|
||||
}, 150, { trailing: true }), []);
|
||||
|
||||
|
|
Loading…
Reference in a new issue