diff --git a/lib/assets/javascripts/turbograft/turbolinks.coffee b/lib/assets/javascripts/turbograft/turbolinks.coffee index 5dec1d32..a9997ad0 100644 --- a/lib/assets/javascripts/turbograft/turbolinks.coffee +++ b/lib/assets/javascripts/turbograft/turbolinks.coffee @@ -75,7 +75,8 @@ class window.Turbolinks options.partialReplace ?= false options.onlyKeys ?= [] options.onLoadFunction = -> - resetScrollPosition() unless options.onlyKeys.length + if !options.onlyKeys.length && !options.keepScrollPosition + resetScrollPosition() options.callback?() fetchReplacement url, options