-
-
Notifications
You must be signed in to change notification settings - Fork 882
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
Window scrolls to top onClick #689
Comments
And a minute after posting this, I find that
However I can still see my viewport/window vertical scrollbar flicker/flash. Not sure if that's fixable or an inherent browser problem. |
The same thing happened to me. React will scroll viewport to the top when components change dimensions on the page. |
I'm having the same issue - after switching the page (but only the 1st time navigation occurs). However, I need PDF to be responsive, so I am using the following CSS: Any ideas why is it happening only when switching to another page only the 1st time and how to solve this? |
@tbagdzius2 Might be helpful if you post up a live page example (assuming you tried what @kubami and I suggested worked for us). |
The issue is every time the page changes, the component re-renders from scratch, one solution as mentioned by @kubami is to set width and height, but according to me only height is enough as only the y axis is scrolling. height attribute should not be in %, use other metric like px or vh, this particular css should work
|
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this issue will be closed in 14 days. |
I am using links for Previous/Next of PDF pages.
The functionality works great (pages go previous/next as expected). However, my viewport/window scrolls to the top anytime the onClick link is clicked. Would appreciate any advice on how to prevent the page window from scrolling. Thanks!
references:
Thanks in advance. One of my absolute favorite React projects!
The text was updated successfully, but these errors were encountered: