views/mdc/assets/js/components/get_event_target.js
export function getEventTarget(event) {
if (typeof event.composedPath === 'function') {
const compTarget = event.composedPath()[0];
if (compTarget) {
return compTarget;
}
if (event.path && event.path[0]) {
return event.path[0];
}
}
return event.target;
}