Skip to content

Commit

Permalink
Merge pull request #4713 from kadirboylu/master
Browse files Browse the repository at this point in the history
Fix #4712 Overlaypanel: Overlaypanel closes when any key is pressed
  • Loading branch information
tugcekucukoglu authored Oct 31, 2023
2 parents 06bb56c + 5e1e7da commit 6f342ad
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions components/lib/overlaypanel/OverlayPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -167,7 +168,7 @@ export default {
}
},
onContentKeydown(event) {
if (event.code === 'Escape') {
if (event.code === 'Escape' && this.closeOnEscape) {
this.hide();
DomHandler.focus(this.target);
}
Expand All @@ -192,7 +193,7 @@ export default {
}
},
onKeyDown(event) {
if (event.code === 'Escape' || this.closeOnEscape) {
if (event.code === 'Escape' && this.closeOnEscape) {
this.visible = false;
}
},
Expand Down

0 comments on commit 6f342ad

Please sign in to comment.