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?

有帮助吗?

解决方案

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
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top