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
14 changes: 12 additions & 2 deletions ui/widgets/mouse.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ return $.widget( "ui.mouse", {
}
},

/**
*
* @param {MouseEvent & { originalEvent: MouseEvent }} event
* @returns {boolean}
*/
_mouseDown: function( event ) {

// don't let more than one widget handle mouseStart
Expand All @@ -89,13 +94,18 @@ return $.widget( "ui.mouse", {

this._mouseDownEvent = event;

var first = (
event.originalEvent && event.originalEvent.composedPath ?
event.originalEvent.composedPath() : [ ]
)[ 0 ] || event.target;

var that = this,
btnIsLeft = ( event.which === 1 ),

// event.target.nodeName works around a bug in IE 8 with
// disabled inputs (#7620)
elIsCancel = ( typeof this.options.cancel === "string" && event.target.nodeName ?
$( event.target ).closest( this.options.cancel ).length : false );
elIsCancel = ( typeof this.options.cancel === "string" && first.nodeName ?
$( first ).closest( this.options.cancel ).length : false );
if ( !btnIsLeft || elIsCancel || !this._mouseCapture( event ) ) {
return true;
}
Expand Down