Skip to content

Commit

Permalink
fix: dynamic columns, forcescroll error
Browse files Browse the repository at this point in the history
  • Loading branch information
berber1016 committed Aug 26, 2022
1 parent 1839388 commit 1ca519f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,9 @@ function Table<RecordType extends DefaultRecordType>(props: TableProps<RecordTyp
target(scrollLeft);
} else if (target.scrollLeft !== scrollLeft) {
// eslint-disable-next-line no-param-reassign
target.scrollLeft = scrollLeft;
setTimeout(() => {
target.scrollLeft = scrollLeft;
}, 0);
}
}

Expand Down
1 change: 1 addition & 0 deletions tests/Scroll.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ describe('Table.Scroll', () => {
},
});
});
jest.runAllTimers();
expect(setScrollLeft).toHaveBeenCalledWith(undefined, 33);
setScrollLeft.mockReset();

Expand Down

0 comments on commit 1ca519f

Please sign in to comment.