[BUG]: Scroll to top functionality not working
shyamtawli opened this issue Β· comments
What happened?
I found a BUG π
When we click on Next or Previous button on the pagination, it should scroll back user to top but somehow it is not working,
Add screenshots
No response
What browsers are you seeing the problem on?
No response
Code of Conduct
- I agree to follow this project's Code of Conduct
Welcome, @shyamtawli! Your issue is like a spark that ignites innovation. We're thrilled to dive into it and work together to find a solution.
Soon the maintainers/owner will review it and provide you with feedback/suggestions.
Regarding this issue, I can:
- implement the feature on pagination that the website refreshes so that it will re-render the DOM
- move the DOM to the top using window object
Please give your feedback on this, or if you have any ideas other than the above-mentioned approaches then please let me know as well.
We have a useEffect when the page changes but somehow it is not working after the migration. If you can have look into I will assign you, Are you willing to work on it?
useEffect(() => {
window.scrollTo({
top: 0,
behavior: 'smooth',
});
}, [currentPage]);
Yeah @shyamtawli you can assign this issue. I will look into it this weekend