Skip to content

Commit 53cb09c

Browse files
authored
fix: scroll offset should not block (#294)
1 parent aaabcb8 commit 53cb09c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/hooks/useScrollDrag.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export function getPageXY(
1010
horizontal: boolean,
1111
) {
1212
const obj = 'touches' in e ? e.touches[0] : e;
13-
return obj[horizontal ? 'pageX' : 'pageY'];
13+
return obj[horizontal ? 'pageX' : 'pageY'] - window[horizontal ? 'scrollX' : 'scrollY'];
1414
}
1515

1616
export default function useScrollDrag(

0 commit comments

Comments
 (0)