diff options
author | Sam Potts <sam@potts.es> | 2019-04-25 12:04:38 +1000 |
---|---|---|
committer | Sam Potts <sam@potts.es> | 2019-04-25 12:04:38 +1000 |
commit | a064f0b4fdc2d654063ff0af651d1abc1604f3f4 (patch) | |
tree | 8d53f39f7b1aae3c909c158f373a641334118ccc /src/js/controls.js | |
parent | b9dbcc30fa499dca9b09c8f92c328cd681612cb6 (diff) | |
parent | 9c1060d9b04f852d98e4fefb1279d273dcb2d9f1 (diff) | |
download | plyr-a064f0b4fdc2d654063ff0af651d1abc1604f3f4.tar.lz plyr-a064f0b4fdc2d654063ff0af651d1abc1604f3f4.tar.xz plyr-a064f0b4fdc2d654063ff0af651d1abc1604f3f4.zip |
Merge branch 'develop' of github.com:sampotts/plyr into develop
Diffstat (limited to 'src/js/controls.js')
-rw-r--r-- | src/js/controls.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/js/controls.js b/src/js/controls.js index d836184c..150dcdd2 100644 --- a/src/js/controls.js +++ b/src/js/controls.js @@ -1140,7 +1140,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 @@ -1193,7 +1195,7 @@ const controls = { // Show a panel in the menu showMenuPanel(type = '', tabFocus = false) { - const target = document.getElementById(`plyr-settings-${this.id}-${type}`); + const target = this.elements.container.querySelector(`#plyr-settings-${this.id}-${type}`); // Nothing to show, bail if (!is.element(target)) { |