pl-fe: fix initial scroll
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
@ -212,13 +212,16 @@ const ScrollableList = React.forwardRef<VirtuosoHandle, IScrollableList>(({
|
||||
/** Figure out the initial index to scroll to. */
|
||||
const initialIndex = useMemo<number | IndexLocationWithAlign>(() => {
|
||||
if (showLoading) return 0;
|
||||
if (typeof initialTopMostItemIndex === 'number') {
|
||||
return {
|
||||
align: 'center',
|
||||
index: initialTopMostItemIndex,
|
||||
};
|
||||
|
||||
if (initialTopMostItemIndex) {
|
||||
if (typeof initialTopMostItemIndex === 'number') {
|
||||
return {
|
||||
align: 'center',
|
||||
index: initialTopMostItemIndex,
|
||||
};
|
||||
}
|
||||
return initialTopMostItemIndex;
|
||||
}
|
||||
if (initialTopMostItemIndex) return initialTopMostItemIndex;
|
||||
|
||||
if (scrollData && history.action === 'POP') {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user