|
@@ -30,9 +30,11 @@ export default function clickOutsideHandler( { emitter, activator, callback, con
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // Check if composedPath is undefined in case the browser does not support native shadow DOM
|
|
|
|
|
+ // Can be removed when all supported browsers support native shadow DOM
|
|
|
|
|
+ const path = domEvt.composedPath !== undefined ? domEvt.composedPath() : [];
|
|
|
for ( const contextElement of contextElements ) {
|
|
for ( const contextElement of contextElements ) {
|
|
|
- if ( contextElement.contains( domEvt.target ) ||
|
|
|
|
|
- ( 'composedPath' in domEvt && domEvt.composedPath().includes( contextElement ) ) ) {
|
|
|
|
|
|
|
+ if ( contextElement.contains( domEvt.target ) || path.includes( contextElement ) ) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|