Skip to content

Commit 38e8d12

Browse files
authored
fix: optimization render task performance (#348)
1 parent 4573fc9 commit 38e8d12

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/TableHeader.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ class TableHeader extends React.PureComponent {
1111
}
1212

1313
scrollTo(offset) {
14-
if (this.headerRef) this.headerRef.scrollLeft = offset;
14+
if (this.headerRef) {
15+
requestAnimationFrame(() => {
16+
this.headerRef.scrollLeft = offset;
17+
});
18+
}
1519
}
1620

1721
renderHeaderRow(height, index) {

0 commit comments

Comments
 (0)