🔀 Merge pull request #1623 from ddenev/master

[Fix] Scolling on mobile brings up menu #1261
This commit is contained in:
Alicia Sykes 2024-06-30 22:39:58 +01:00 committed by GitHub
commit 89aeb0b007
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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);