From 8171ddd8de5412bcae8c618898617f9501da8bab Mon Sep 17 00:00:00 2001 From: Dolphin_Wood Date: Sat, 21 Apr 2018 18:24:56 +0900 Subject: [PATCH] fix(scrollIntoView): fix offsetBottom calculation --- src/scrolling/scroll-into-view.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scrolling/scroll-into-view.ts b/src/scrolling/scroll-into-view.ts index 5e378bcb..981a89f3 100644 --- a/src/scrolling/scroll-into-view.ts +++ b/src/scrolling/scroll-into-view.ts @@ -26,7 +26,7 @@ export function scrollIntoView( if (onlyScrollIfNeeded && scrollbar.isVisible(elem)) return; - const delta = alignToTop ? targetBounding.top - bounding.top - offsetTop : targetBounding.bottom - bounding.bottom - offsetBottom; + const delta = alignToTop ? targetBounding.top - bounding.top - offsetTop : targetBounding.bottom - bounding.bottom + offsetBottom; scrollbar.setMomentum( targetBounding.left - bounding.left - offsetLeft,