From 5dcdff4b37eedd8ff465dcce97011dcdd840da85 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Sun, 7 Oct 2018 11:23:41 +0200 Subject: [PATCH] Fix scrolling with tc-adjust-top-of-scroll (#3467) not multiplying `offset` with t causes jumps at the first animation steps, where the offset value is bigger than `endY - scrollPosition.y` --- core/modules/utils/dom/scroller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/modules/utils/dom/scroller.js b/core/modules/utils/dom/scroller.js index d87ef03f2..f7f5c0c3f 100644 --- a/core/modules/utils/dom/scroller.js +++ b/core/modules/utils/dom/scroller.js @@ -104,7 +104,7 @@ PageScroller.prototype.scrollIntoView = function(element) { bounds = getBounds(), endX = getEndPos(bounds.left,bounds.width,scrollPosition.x,window.innerWidth), endY = getEndPos(bounds.top,bounds.height,scrollPosition.y,window.innerHeight); - window.scrollTo(scrollPosition.x + (endX - scrollPosition.x) * t,scrollPosition.y + (endY - scrollPosition.y) * t - offset); + window.scrollTo(scrollPosition.x + (endX - scrollPosition.x) * t,scrollPosition.y + (endY - scrollPosition.y - offset) * t); if(t < 1) { self.idRequestFrame = self.requestAnimationFrame.call(window,drawFrame); }