Skip to content

Commit

Permalink
Ignore other mouse buttons during a left button gesture
Browse files Browse the repository at this point in the history
Ref: "free" event doesn't fire if you right click during drag and drop #3005
  • Loading branch information
maxkfranz committed Jun 18, 2024
1 parent f6f28ee commit 7d845ee
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/extensions/renderer/base/load-listeners.js
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,11 @@ BRp.load = function(){
r.registerBinding( r.container, 'mousedown', function mousedownHandler( e ){
if( !eventInContainer(e) ){ return; }

// during left mouse button gestures, ignore other buttons
if (r.hoverData.which === 1 && e.which !== 1) {
return;
}

e.preventDefault();

blurActiveDomElement();
Expand Down Expand Up @@ -833,6 +838,11 @@ BRp.load = function(){

let clickTimeout, didDoubleClick, prevClickTimeStamp;
r.registerBinding( containerWindow, 'mouseup', function mouseupHandler( e ){ // eslint-disable-line no-undef
// during left mouse button gestures, ignore other buttons
if (r.hoverData.which === 1 && e.which !== 1 && r.hoverData.capture) {
return;
}

var capture = r.hoverData.capture;
if( !capture ){ return; }
r.hoverData.capture = false;
Expand Down

0 comments on commit 7d845ee

Please sign in to comment.