Question

I am depeloping a Rails app with Turbolinks. And I am using links to URLs like mysite.com/page#element. The issue is that when I click this link from another page, like mysite.com/anotherpage, in Chrome I am being scrolled to the element but then the next moment scrolled back to the top of the page. This issue doesn't appear neither in Firefox nor in Opera. And it also doesn't appear with Turbolinks turned off. Is there any way to solve this problem for Chrome without rejecting Turbolinks?

Was it helpful?

Solution

I think you are using an outdated version of turbolinks. There was a similar bug reported and it was fixed in a version 2 months ago I would try to remove the specific version of turbo links you have referenced in your gem file.

gem 'turbolinks'

Instead of

gem 'turbolinks', '~> 1.2'

(Or whatever version you have running)

And then running

$ bundle install
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top