Closed vizo closed 8 years ago
Could you provide a test app for reproducing this?
I don't think the solution is to expose the scroll
option server-side.
Use case is when you update some resource "inline" (single page). For example you have list of items with edit button which calls turbolinks.visit to edit inline (to show form for this item on list) and after save you do redirect_to with anchor to scroll back to saved item on list. But without scroll true it doesn't scroll to anchor (to saved item on list).
I can send you private message with link to my private app where i use this.
I think if change param is exposed to server side, i don't see problem to expose scroll as well ;)
The fix isn't to expose scroll
server-side. We should make Turbolinks.visit
with change
scroll to the URL fragment by default, instead of leaving the scroll position unchanged.
I will take care of this in the coming weeks.
Yes i agree, this solution is better. Thanks :)
When using redirect_to with anchor, change and scroll:true, it doesn't scroll to anchor.
I checked source code and i see that scroll param is never passed from server to client side. I fixed this also in pull request https://github.com/rails/turbolinks/pull/588.