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
{{ message }}
This repository has been archived by the owner on Jul 28, 2018. It is now read-only.
You'll see that the content is properly preserved, but the scroll position is not.
This could be a reason to bring back something like #583. My use case would work if I could do something like this:
<body><divdata-turbolinks-root>
part of page that is replaced by turbolinks
</div><divclass="some-permanent-element-that-overflow-scrolls">
part of page that turbolinks doesn't touch
</div></body>
I have a chat widget on the page that should maintain it's scroll position to the bottom where the latest messages are.
The text was updated successfully, but these errors were encountered:
I should mention that my current workaround is to listen to page:before-unload and save scroll positions. Then on page:update restoring those scroll positions. Would be nice if I didn't have to do that for each scroll view though.
I've been trying for the last 2 days to try and get turbolinks to persist elements. What's the secret? Elements I annotate with the data-turbolinks-permanent are not persisting. I copied your html and when I clicked on a link, it disappeared, even though the network tab shows it was loaded via turbolinks. I've tried v3 and v5 to no avail.
this will work if you don't want to worry about permanent
varscrollLeft=0;//restore the menu position$(document).on('page:change',function(){$('.menu').scrollLeft(scrollLeft);});//before the current page goes away, save the menu position$(document).on('page:before-unload',function(){scrollLeft=$('.menu').scrollLeft();});
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Elements with
data-turbolinks-permanent
and a style ofoverflow: scroll
are losing scroll position when navigation/replacement occurs.Example html that can be dropped into any turbolinks page.
You'll see that the content is properly preserved, but the scroll position is not.
This could be a reason to bring back something like #583. My use case would work if I could do something like this:
I have a chat widget on the page that should maintain it's scroll position to the bottom where the latest messages are.
The text was updated successfully, but these errors were encountered: