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) {
4141 } , 0 ) ;
4242
4343 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,
4545 // because it tests whether the element was there at the time of
4646 // the click, not whether it is there now, that the event has arrived
4747 // 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 ) ) ) {
4951 return callback ( ev ) ;
5052 }
5153 } ;
You can’t perform that action at this time.
0 commit comments