aboutsummaryrefslogtreecommitdiffstats
path: root/src/js
diff options
context:
space:
mode:
authorEmiel Beinema <emiel.beinema@gmail.com>2019-04-15 12:17:10 +0200
committerEmiel Beinema <emiel.beinema@gmail.com>2019-04-15 12:17:10 +0200
commita91652287b10237552b6b1ac87c8286aff4f583d (patch)
tree327059f99a83306f526424b2b9eccb686eaf7f23 /src/js
parent2cf44c236d586ca07f03744a3df8ffeff425b8f7 (diff)
downloadplyr-a91652287b10237552b6b1ac87c8286aff4f583d.tar.lz
plyr-a91652287b10237552b6b1ac87c8286aff4f583d.tar.xz
plyr-a91652287b10237552b6b1ac87c8286aff4f583d.zip
Don't close menu on click in menu in webcomponent
Diffstat (limited to 'src/js')
-rw-r--r--src/js/controls.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/js/controls.js b/src/js/controls.js
index 104f5c95..275ffb3f 100644
--- a/src/js/controls.js
+++ b/src/js/controls.js
@@ -1138,7 +1138,9 @@ const controls = {
} else if (is.keyboardEvent(input) && input.which === 27) {
show = false;
} else if (is.event(input)) {
- const isMenuItem = popup.contains(input.target);
+ // If Plyr is in a shadowDOM, the event target is set to the component, instead of the
+ // element in the shadowDOM. The path, however, is complete.
+ const isMenuItem = popup.contains(input.path[0]);
// If the click was inside the menu or if the click
// wasn't the button or menu item and we're trying to