-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
CriOS mobile scroll to top bug #3047
Comments
I'm not sure what you expect us to do here – it's not like As you're providing the scroll management, I don't see how this isn't just something else you'd have to work around on your side. |
Well it seems like it's a bug in CriOS but I can't tell if it's a bug in the browser, in this library, or some other library. I was hoping you'd have some insight into that. |
Furthermore, because this bug only happens on route transitions, it seems far more likely that something is happening in the bowels of either react-router or history. My guess would be history but at this point I've been reading source code so long I'm code blind. |
You're calling |
I don't think it's an unfair assumption to make when the bug was introduced by upgrading the history and react-router packages in my application. |
Given the following route setup in conjunction with server side rendering:
I have my application scroll to the top of the document on a route change provided that the location state is undefined (I use defined states for custom scrolling within components). For example every time a nav bar link is pressed, the site url with change, the proper page will be loaded, and the document will scroll to top.
However, and this only happens in CriOS, the document doesn't scroll. It will navigate to the correct page but the scroll offset of the window never changes. More interestingly, it only happens when the destination path is different from the source path so for example if I press the
/home
link while on/home
, the document scrolls to to the top as expected. If I'm on/home
and I navigate to/concat
, it doesn't work.I've tested this on mobile Chrome, Firefox, and Safari and as well as all the desktop counterparts and it only occurs in CriOS. I originally suspected it's somewhat related to this issue (which has since been fixed, woot woot) but there's no hard refresh going on upon navigation.
The text was updated successfully, but these errors were encountered: