Skip to content

Commit

Permalink
chore(core): remove padding from alignment calculations
Browse files Browse the repository at this point in the history
  • Loading branch information
Grsmto committed Sep 24, 2022
1 parent 07d97b4 commit 03cf8aa
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions packages/core/src/scrollTo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,11 @@ export const scrollTo = ({
const item = mapItem({ element, viewport });

let target = { left: 0, top: 0 };

switch (item.snapAlign) {
case 'start':
target = {
left:
item.left -
item.paddingLeft -
viewport.paddingLeft -
viewport.scrollPaddingLeft,
left: item.left - viewport.paddingLeft - viewport.scrollPaddingLeft,
top:
item.top -
item.paddingTop -
Expand Down

0 comments on commit 03cf8aa

Please sign in to comment.