-
Notifications
You must be signed in to change notification settings - Fork 415
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
Turbo scrolls to Top of current page before rendering new visited page (related to data-turbo-track="reload") #387
Comments
maybe solves hotwired#387
Thanks for reporting this! We've bumped into a similar issue. I've been debugging for a bit but no success yet. I can report that I can repro the issue by running the server and going to http://localhost:9000/src/tests/fixtures/rendering.html. Then, scroll down (you may need to shrink the height of your window), and click on "Visit control: reload". The URL will update, the page scroll up, and then navigate. |
I've determined the problem is in Line 411 in da35d5b
|
Potential solution for hotwired#387
* Don't scroll on reload Potential solution for #387 * Be more specific with the check * Put the check back * Guard the performScroll call directly * WIP - spec * Properly assert in scroll spec Co-authored-by: manuelpuyol@github.com * Update rendering_tests.ts
@chipairon does #571 resolve your issue? |
I have a demo of the issue here https://prairie-swamp-observatory.glitch.me/index.html
second_page.html
has a script withdata-turbo-track="reload"
that the first page does NOT have.When clicking the link at the bottom of the page (from either page):
1- The scroll is moved to the top of the current page.
2- Then the new page is rendered.
My expectation would be that the current page is not scrolled to top before the next page is rendered.
If the
turbo-track:reload
attribute is removed from the script tag, the scroll does not happen:The source code of the demo is here: https://glitch.com/edit/#!/remix/prairie-swamp-observatory
The demo loads Turbo from skypack (currently
@hotwired/turbo@7.0.0-rc.3
).PS: it might be related to the behaviour described in #114 but I'm not sure.
The text was updated successfully, but these errors were encountered: