Skip to content

Commit 5b60558

Browse files
authored
fix: Sync scroll bar when data change (#646) (#647)
1 parent 2e88ea8 commit 5b60558

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Table.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -492,13 +492,13 @@ function Table<RecordType extends DefaultRecordType>(props: TableProps<RecordTyp
492492
}
493493
};
494494

495-
// Sync scroll bar when init or `horizonScroll` changed
495+
// Sync scroll bar when init or `horizonScroll` & `data` changed
496496
React.useEffect(() => triggerOnScroll, []);
497497
React.useEffect(() => {
498498
if (horizonScroll) {
499499
triggerOnScroll();
500500
}
501-
}, [horizonScroll]);
501+
}, [horizonScroll, data]);
502502

503503
// ===================== Effects ======================
504504
const [scrollbarSize, setScrollbarSize] = React.useState(0);

0 commit comments

Comments
 (0)