Skip to content

Commit b88cfde

Browse files
committed
Mouse: Update elIsCancel to use composedPath instead of event.target
When using web-components with shadowRoot, the mouseDown event is triggered with the event.target pointing to the entire web component, not inner nodes that were clicked, thus to cancel the mouseDown based on inner-elements we have to use composedPath instead of event.target
1 parent 3a1b590 commit b88cfde

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ui/widgets/mouse.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,10 @@ return $.widget( "ui.mouse", {
9494

9595
this._mouseDownEvent = event;
9696

97-
let [ first = event.target ] = 'composedPath' in event.originalEvent && event.originalEvent.composedPath() || []
97+
var first = (
98+
event.originalEvent && event.originalEvent.composedPath ?
99+
event.originalEvent.composedPath() : [ ]
100+
)[ 0 ] || event.target;
98101

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

0 commit comments

Comments
 (0)