]> BookStack Code Mirror - bookstack/blobdiff - resources/js/components/dropdown.js
Added testing for our request method overrides
[bookstack] / resources / js / components / dropdown.js
index 22402d483902b2148918150e1d371611dd1abf9b..f761ecf011541590963caf66daf4b145f43c8cde 100644 (file)
@@ -12,6 +12,7 @@ class DropDown {
         this.menu = this.$refs.menu;
         this.toggle = this.$refs.toggle;
         this.moveMenu = this.$opts.moveMenu;
+        this.bubbleEscapes = this.$opts.bubbleEscapes === 'true';
 
         this.direction = (document.dir === 'rtl') ? 'right' : 'left';
         this.body = document.body;
@@ -137,7 +138,9 @@ class DropDown {
             } else if (event.key === 'Escape') {
                 this.hide();
                 this.toggle.focus();
-                event.stopPropagation();
+                if (!this.bubbleEscapes) {
+                    event.stopPropagation();
+                }
             }
         };
         this.container.addEventListener('keydown', keyboardNavigation);