Skip to content

Commit

Permalink
🔀 Merge pull request #1623 from ddenev/master
Browse files Browse the repository at this point in the history
[Fix] Scolling on mobile brings up menu #1261
  • Loading branch information
Lissy93 authored Jun 30, 2024
2 parents 23f7a84 + b32852c commit 89aeb0b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/directives/LongPress.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,17 @@ export default {
document.removeEventListener('pointerup', onPointerUp);
};

const onPointerMove = () => {
clearTimeout(parseInt(el.dataset.longPressTimeout, 10));
document.removeEventListener('pointermove', onPointerMove);
};

const onPointerDown = (e) => {
// If event was right-click, then immediately trigger
if (e.button === 2) return;
startTime = Date.now();
document.addEventListener('pointerup', onPointerUp);
el.addEventListener('pointermove', onPointerMove);
el.addEventListener('click', swallowClick);
const timeoutDuration = LONG_PRESS_DEFAULT_DELAY;
const timeout = setTimeout(triggerEvent, timeoutDuration);
Expand Down

0 comments on commit 89aeb0b

Please sign in to comment.