You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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):
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.
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:
<a href="/about">About</a>
Expected Behavior:
Scroll preservation should only apply:
Actual Behavior:
Environment:
Turbo Version: 8.0.11
Browser: Safari 18.1.1, Chrome 131
Operating System: macOS 15.1.1
The text was updated successfully, but these errors were encountered: