Skip to content

Commit

Permalink
fix: get the touch that started on the slider
Browse files Browse the repository at this point in the history
  • Loading branch information
sus-yoshikane-t committed Sep 11, 2024
1 parent 0b1f05b commit ede6915
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hooks/useDrag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type { OffsetValues } from './useOffset';
const REMOVE_DIST = 130;

function getPosition(e: React.MouseEvent | React.TouchEvent | MouseEvent | TouchEvent) {
const obj = 'touches' in e ? e.touches[0] : e;
const obj = 'targetTouches' in e ? e.targetTouches[0] : e;

return { pageX: obj.pageX, pageY: obj.pageY };
}
Expand Down

0 comments on commit ede6915

Please sign in to comment.