Hearen / antd-demo

Used to check the features of antd
MIT License
0 stars 0 forks source link

auto-scroll to the newly added row #21

Open Hearen opened 6 years ago

Hearen commented 6 years ago

window.document.getElementsByClassName('ant-table-tbody')[0].getElementsByClassName('ant-table-row-level-0')[0].scrollIntoView('smooth');//scroll to the first row (adding new row when in the middle of the table);

Hearen commented 6 years ago

scrollIntoView doc; https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView

and run the online test:

https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_element_scrollintoview