The problem of table component about scroll in antd

official example: https://ant.design/components...

how to control how to position the current scroll bar to the top of the table when you turn the page? This ensures that the list data is read from top to bottom each time you turn the page.

the current official scroll bar is still in place after the current page reading list has slipped down.

Apr.29,2022

you can write one yourself.

get the dom of table

<Table ref={(ref)=>this.table=ref} />
const table = ReactDom.findDOMNode(this.table),
      tableBody = table.querySelector('.ant-table-body');

then when you turn the page, just put the scroll bar to the top

tableBody.scrollTop = 0;
After

3.24.0, the configuration item scrollToFirstRowOnChange has been added to the scroll attribute. You can try it.


you can try to get the table element and set it scrollTop to 0

every time you click to turn the page.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3ec3f-2c448.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3ec3f-2c448.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?