fix: overlaypanel only be closed on escape key pressed

#4712
https://github.com/primefaces/primevue/issues/4712
pull/4713/head
Kadir Boylu 2023-10-29 14:46:20 +03:00
parent 2d4b5544a3
commit 851103fac9
1 changed files with 2 additions and 1 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');
@ -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;
} }
}, },