Merge pull request #4713 from kadirboylu/master

Fix #4712 Overlaypanel: Overlaypanel closes when any key is pressed
pull/4806/head
Tuğçe Küçükoğlu 2023-10-31 13:53:43 +03:00 committed by GitHub
commit 6f342ad243
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -139,6 +139,7 @@ export default {
this.unbindOutsideClickListener(); this.unbindOutsideClickListener();
this.unbindScrollListener(); this.unbindScrollListener();
this.unbindResizeListener(); this.unbindResizeListener();
this.unbindDocumentKeyDownListener();
OverlayEventBus.off('overlay-click', this.overlayEventListener); OverlayEventBus.off('overlay-click', this.overlayEventListener);
this.overlayEventListener = null; this.overlayEventListener = null;
this.$emit('hide'); this.$emit('hide');
@ -167,7 +168,7 @@ export default {
} }
}, },
onContentKeydown(event) { onContentKeydown(event) {
if (event.code === 'Escape') { if (event.code === 'Escape' && this.closeOnEscape) {
this.hide(); this.hide();
DomHandler.focus(this.target); DomHandler.focus(this.target);
} }
@ -192,7 +193,7 @@ export default {
} }
}, },
onKeyDown(event) { onKeyDown(event) {
if (event.code === 'Escape' || this.closeOnEscape) { if (event.code === 'Escape' && this.closeOnEscape) {
this.visible = false; this.visible = false;
} }
}, },