Skip to content

Commit

Permalink
fix: scroll offset should not block (#294)
Browse files Browse the repository at this point in the history
  • Loading branch information
zombieJ authored Dec 16, 2024
1 parent aaabcb8 commit 53cb09c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hooks/useScrollDrag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export function getPageXY(
horizontal: boolean,
) {
const obj = 'touches' in e ? e.touches[0] : e;
return obj[horizontal ? 'pageX' : 'pageY'];
return obj[horizontal ? 'pageX' : 'pageY'] - window[horizontal ? 'scrollX' : 'scrollY'];
}

export default function useScrollDrag(
Expand Down

0 comments on commit 53cb09c

Please sign in to comment.