Polyfill for the JavaScript Event path/composedPath property (related Stack Overflow thread)
Call the propagationPath
method on any Event object.
window.addEventListener('click', (event) => {
if (!event.propagationPath().includes(this.container)) {
this.container.classList.remove('expanded');
}
return false;
};);