-
Couldn't load subscription status.
- Fork 472
Open
Description
Description:
When navigating to a page (e.g., the blog index) that uses data-turbo-action="advance", Turbo starts preserving scroll positions globally for all subsequent navigations, even on pages that do not use data-turbo-action="advance". The issue only occurs after visiting the page with this attribute—if the page is never visited, scroll behavior works as expected.
Steps to Reproduce:
- Add data-turbo-action="advance" to a link on the blog index page (/blog):
<turbo-frame id="blog_posts" src="{{ path('app.blog.index', routeParams) }}"data-turbo-action="advance">
- Visit the /blog page.
- Navigate to an unrelated page (e.g., /about) using a standard Turbo-enabled link:
<a href="/about">About</a> - Observe that the scroll position on the /about page is preserved from the /blog page, even though data-turbo-action="advance" is not used on the /about page.
Expected Behavior:
Scroll preservation should only apply:
- Within the context of the /blog page where data-turbo-action="advance" is explicitly used.
- Scroll position should reset appropriately when navigating to unrelated pages (e.g., /about).
Actual Behavior:
- After visiting the /blog page and using data-turbo-action="advance", Turbo globally preserves scroll positions across all subsequent pages.
- This behavior persists for unrelated pages (e.g., /about), even if they do not use data-turbo-action="advance".
- If the /blog page is not visited, scroll behavior works as expected, resetting to the top for each new page.
Environment:
Turbo Version: 8.0.11
Browser: Safari 18.1.1, Chrome 131
Operating System: macOS 15.1.1
nicowenterodt, AsWali, jibees, jsuchal, leonvogt and 1 more
Metadata
Metadata
Assignees
Labels
No labels