Skip to content
This repository has been archived by the owner on Jul 28, 2018. It is now read-only.

redirect_to and scroll to acnhor #589

Closed
vizo opened this issue Aug 14, 2015 · 4 comments
Closed

redirect_to and scroll to acnhor #589

vizo opened this issue Aug 14, 2015 · 4 comments

Comments

@vizo
Copy link

vizo commented Aug 14, 2015

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 #588.

@Thibaut
Copy link
Collaborator

Thibaut commented Sep 20, 2015

Could you provide a test app for reproducing this?
I don't think the solution is to expose the scroll option server-side.

@vizo
Copy link
Author

vizo commented Sep 20, 2015

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 ;)

@Thibaut
Copy link
Collaborator

Thibaut commented Sep 20, 2015

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.

@vizo
Copy link
Author

vizo commented Sep 21, 2015

Yes i agree, this solution is better. Thanks :)

@Thibaut Thibaut closed this as completed in 01ec408 Oct 4, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants