-
Notifications
You must be signed in to change notification settings - Fork 289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scroll to row #38
Comments
Best way to do this is to inform your application in componentDidUpdate that it has finished scrolling to the top, so the subsequent render doesn't set scrollToRow to zero. Here is a very simple example: https://jsfiddle.net/z2yhpwLh/ |
hey thanks for the prompt response.
I have removed all the extra data from the above code so that it's easy to understand. So basically the main logic is that I will only scroll the table to top when the value of |
Looks great! Let me know if you see any bugs with that in the future. |
I want to make my table scroll to top when some event happens. For example when user sorts the table data, i want the user to be moved to the top of the table. For this I am using the
scrollToRow
property. So I have ascrollToRow
property in my state that I set to0
when the user sorts the data and then the cursor moves to the top of the table.Problem
Now when I scroll inside my table and then some other action happens, the state changes and the table is re-rendered and it scrolls to the top because the
scrollToRow
property in my state is still0
. What is the best way to tackle this issue?The text was updated successfully, but these errors were encountered: