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.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;
}
},