Skip to content

Turbo scrolls to Top of current page before rendering new visited page (related to data-turbo-track="reload") #387

@chipairon

Description

@chipairon

I have a demo of the issue here https://prairie-swamp-observatory.glitch.me/index.html
second_page.html has a script with data-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:

<script src="/second_page_script.js" defer data-turbo-track="reload"></script>

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions