Merge pull request #4713 from kadirboylu/master
Fix #4712 Overlaypanel: Overlaypanel closes when any key is pressedpull/4806/head
commit
6f342ad243
|
@ -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;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue