zeon-studio / nextplate

Nextplate is a free starter template built with Next.js and TailwindCSS. It provides you with almost everything you need to jump-start your Next.js project. Try Nextplate and save yourself hours of work.
https://zeon.studio/preview?project=nextplate
MIT License
427 stars 252 forks source link

Default scroll restoration not working in Nextplate app #3

Closed HamzaUlRehman closed 1 year ago

HamzaUlRehman commented 1 year ago

When using Next.js, the default scroll restoration behavior is expected to automatically scroll the page to the top (position 0) when navigating to a new route. However, in the Nextplate app, this default behavior does not seem to be working correctly.

Currently, when navigating to a new route in the Nextplate app, the scroll position is not being reset to the top as expected. This can cause confusion and inconvenience for users, especially when they expect the page to start from the beginning when switching between routes.

It is important to resolve this issue to provide a seamless user experience and ensure consistent behavior with the default Next.js scroll restoration functionality.

Steps to Reproduce:

Open the Nextplate app. Navigate to a different route within the app. Observe that the scroll position does not reset to the top of the page. Expected Behavior: When navigating to a new route in the Nextplate app, the scroll position should reset to the top of the page by default, just like in a regular Next.js application.

Actual Behavior: The scroll position in the Nextplate app does not reset to the top when navigating to a new route, deviating from the default Next.js behavior.

Please note that this issue may affect the overall user experience of the Nextplate app and should be addressed to provide a consistent and intuitive browsing experience.

tfsomrat commented 1 year ago

@HamzaUlRehman thanks for noticing this. I have added a fix for it. Please have a look at it.