X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/857d9ed3f129e1278973939ca10f3358d447effe..refs/pull/3039/head:/resources/js/components/dropdown.js diff --git a/resources/js/components/dropdown.js b/resources/js/components/dropdown.js index 22402d483..f761ecf01 100644 --- a/resources/js/components/dropdown.js +++ b/resources/js/components/dropdown.js @@ -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);