Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions src/js/utils/dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down