Skip to content

Commit 1646680

Browse files
committed
Fix scroll resetting x axis on pagination
1 parent 619c295 commit 1646680

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/firecms_core/src/components/VirtualTable/VirtualTable.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,8 @@ export const VirtualTable = React.memo<VirtualTableProps<any>>(
131131
// Set initial scroll position
132132
useEffect(() => {
133133
if (tableRef.current && initialScroll) {
134-
tableRef.current.scrollTo(0, initialScroll);
134+
const { scrollLeft } = tableRef.current;
135+
tableRef.current.scrollTo(scrollLeft, initialScroll);
135136
}
136137
}, [tableRef, initialScroll]);
137138

0 commit comments

Comments
 (0)