diff --git a/components/lib/overlaypanel/OverlayPanel.vue b/components/lib/overlaypanel/OverlayPanel.vue index 19fdcc1deb..b25749a808 100755 --- a/components/lib/overlaypanel/OverlayPanel.vue +++ b/components/lib/overlaypanel/OverlayPanel.vue @@ -139,6 +139,7 @@ export default { this.unbindOutsideClickListener(); this.unbindScrollListener(); this.unbindResizeListener(); + this.unbindDocumentKeyDownListener(); OverlayEventBus.off('overlay-click', this.overlayEventListener); this.overlayEventListener = null; this.$emit('hide'); @@ -167,7 +168,7 @@ export default { } }, onContentKeydown(event) { - if (event.code === 'Escape') { + if (event.code === 'Escape' && this.closeOnEscape) { this.hide(); DomHandler.focus(this.target); } @@ -192,7 +193,7 @@ export default { } }, onKeyDown(event) { - if (event.code === 'Escape' || this.closeOnEscape) { + if (event.code === 'Escape' && this.closeOnEscape) { this.visible = false; } },