Skip to content

Commit

Permalink
Fix useSnapPoints onRelease position (#227)
Browse files Browse the repository at this point in the history
  • Loading branch information
suphon-t committed Jan 25, 2024
1 parent 7f9b5d0 commit 85f6b45
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/use-snap-points.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ export function useSnapPoints({

const currentPosition =
direction === 'bottom' || direction === 'right'
? activeSnapPointOffset ?? 0 - draggedDistance
: activeSnapPointOffset ?? 0 + draggedDistance;
? (activeSnapPointOffset ?? 0) - draggedDistance
: (activeSnapPointOffset ?? 0) + draggedDistance;
const isOverlaySnapPoint = activeSnapPointIndex === fadeFromIndex - 1;
const isFirst = activeSnapPointIndex === 0;
const hasDraggedUp = draggedDistance > 0;
Expand Down

0 comments on commit 85f6b45

Please sign in to comment.