Skip to content

Commit

Permalink
fix: optimization render task performance (#348)
Browse files Browse the repository at this point in the history
  • Loading branch information
Janlaywss authored Dec 24, 2021
1 parent 4573fc9 commit 38e8d12
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/TableHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ class TableHeader extends React.PureComponent {
}

scrollTo(offset) {
if (this.headerRef) this.headerRef.scrollLeft = offset;
if (this.headerRef) {
requestAnimationFrame(() => {
this.headerRef.scrollLeft = offset;
});
}
}

renderHeaderRow(height, index) {
Expand Down

0 comments on commit 38e8d12

Please sign in to comment.