File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -41,11 +41,13 @@ function bind(el, binding) {
41
41
} , 0 ) ;
42
42
43
43
el [ HANDLER ] = function ( ev ) {
44
- // @NOTE : this test used to be `el.containts`, but `ev. path` is better,
44
+ // @NOTE : this test used to be just `el.containts`, but working with path is better,
45
45
// because it tests whether the element was there at the time of
46
46
// the click, not whether it is there now, that the event has arrived
47
47
// to the top.
48
- if ( initialMacrotaskEnded && ev . path . indexOf ( el ) < 0 ) {
48
+ // @NOTE : `.path` is non-standard, the standard way is `.composedPath()`
49
+ var path = ev . path || ( ev . composedPath ? ev . composedPath ( ) : undefined ) ;
50
+ if ( initialMacrotaskEnded && ( path ? path . indexOf ( el ) < 0 : ! el . contains ( ev . target ) ) ) {
49
51
return callback ( ev ) ;
50
52
}
51
53
} ;
You can’t perform that action at this time.
0 commit comments