Your bug may already be fixed in the latest release. Run yarn upgrade react-table!
6.7.4
When using a scrollable list with fixed headers and paging, changing the page or the rows/page does not scroll the list to the top. I believe it should. We worked around this by doing the scrollTop within onFetchData. Horizontal scrolling should (and does) get maintained.
This issue can be seen using the react-table example...https://react-table.js.org/#/story/fixed-header-w-vertical-scroll
Regards,
Scott Alden (IQVIA)
scott.[email protected]
I Also have this problem.
@aldensc For a workaround i added to ReactTable props:
onPageChange={() => {
document.getElementsByClassName('rt-tbody')[0].scrollTop = 0;
}}
Since this is a question of implementation we invite you to continue the conversation in the react tools slack organization. Thanks! https://react-chat-signup.herokuapp.com/
well it worked for me but If I do something like document.getElementsByClassName('rt-tbody')[1].scrollTo(0,0)
Any solution to this apart from following:
document.getElementsByClassName('rt-tbody')[0].scrollTop = 0;
Most helpful comment
I Also have this problem.
@aldensc For a workaround i added to ReactTable props:
onPageChange={() => {
document.getElementsByClassName('rt-tbody')[0].scrollTop = 0;
}}