Skip to content

Commit 8171ddd

Browse files
committed
fix(scrollIntoView): fix offsetBottom calculation
1 parent 574026f commit 8171ddd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/scrolling/scroll-into-view.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export function scrollIntoView(
2626

2727
if (onlyScrollIfNeeded && scrollbar.isVisible(elem)) return;
2828

29-
const delta = alignToTop ? targetBounding.top - bounding.top - offsetTop : targetBounding.bottom - bounding.bottom - offsetBottom;
29+
const delta = alignToTop ? targetBounding.top - bounding.top - offsetTop : targetBounding.bottom - bounding.bottom + offsetBottom;
3030

3131
scrollbar.setMomentum(
3232
targetBounding.left - bounding.left - offsetLeft,

0 commit comments

Comments
 (0)