diff --git a/src/js/utils/dom.js b/src/js/utils/dom.js index 0505850064..a2d4a9961c 100644 --- a/src/js/utils/dom.js +++ b/src/js/utils/dom.js @@ -775,18 +775,15 @@ export function isSingleLeftClick(event) { return true; } - // `mouseup` event on a single left click has - // `button` and `buttons` equal to 0 - if (event.type === 'mouseup' && event.button === 0 && + // `button` and `buttons` are both 0 on `mouseup` (release) and on + // `mousedown` when a Mac trackpad tap-to-click fires {button:0, buttons:0}. + // The only event type where {0,0} should be rejected is `mousemove`, + // because it signals that the button was released during a drag. + if (event.type !== 'mousemove' && event.button === 0 && event.buttons === 0) { return true; } - // MacOS Sonoma trackpad when "tap to click enabled" - if (event.type === 'mousedown' && event.button === 0 && event.buttons === 0) { - return true; - } - if (event.button !== 0 || event.buttons !== 1) { // This is the reason we have those if else block above // if any special case we can catch and let it slide