Skip to content

Commit

Permalink
fix(scrollIntoView): fix offsetBottom calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
idiotWu committed Apr 21, 2018
1 parent 574026f commit 8171ddd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/scrolling/scroll-into-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 8171ddd

Please sign in to comment.