Commit cc458e8d authored by Xavi Ferrer's avatar Xavi Ferrer Committed by JC Brand

use composedPath() instead as it is standarized and cross-browser suported

parent 37662e8d
...@@ -15,7 +15,7 @@ export class BaseDropdown extends CustomElement { ...@@ -15,7 +15,7 @@ export class BaseDropdown extends CustomElement {
this.button = this.dropdown.querySelector('button'); this.button = this.dropdown.querySelector('button');
this.dropdown.addEventListener('click', ev => this.toggleMenu(ev)); this.dropdown.addEventListener('click', ev => this.toggleMenu(ev));
this.dropdown.addEventListener('keyup', ev => this.handleKeyUp(ev)); this.dropdown.addEventListener('keyup', ev => this.handleKeyUp(ev));
document.addEventListener('click', ev => !this.contains(ev.originalTarget || ev.path[0]) && this.hideMenu(ev)); document.addEventListener('click', ev => !this.contains(ev.composedPath()[0]) && this.hideMenu(ev));
} }
hideMenu () { hideMenu () {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment