Why is it that NextJS cannot auto-scroll when there are fixed elements on the page? #64534
Replies: 2 comments 4 replies
-
The reason why Nextjs cannot perform auto-scroll when there are fixed elements on the page is related to how the When an element is fixed (position: fixed) or sticks (position: stricky) to the browser window, it is taken out of the normal flow of the As a result, when Next attemps to perform auto-scroll to a specific element on the page, it cannot accurately calculate the position of the |
Beta Was this translation helpful? Give feedback.
-
in my case i was getting the same warning because i had a modal with parallel routes, then the problem went away by adding |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
I have a fixed navbar and get the following warning:
The warning is gone if I set
scroll={false}
as per the docs.However, I am not sure I understand why NextJS cannot auto-scroll when there are fixed elements on the page?
Beta Was this translation helpful? Give feedback.
All reactions