Skip to content

Commit

Permalink
fix: 明确设置touchstart/touchmove事件的passive配置项 (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
champkeh committed May 25, 2023
1 parent 4f9b35a commit 2e26cd1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/moveable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ export function moveable(el: HTMLElement) {
document.addEventListener('mousemove', move, false);
document.addEventListener('mouseup', end, false);

document.addEventListener('touchmove', move, false);
document.addEventListener('touchmove', move, { capture: false, passive: false });
document.addEventListener('touchend', end, false);
}

el.addEventListener('mousedown', start, false);
el.addEventListener('touchstart', start, false);
el.addEventListener('touchstart', start, { capture: false, passive: false });
}

0 comments on commit 2e26cd1

Please sign in to comment.