diff --git a/src/app/components/overlaypanel/overlaypanel.ts b/src/app/components/overlaypanel/overlaypanel.ts index dc54dc80eac..ef2749b54d4 100755 --- a/src/app/components/overlaypanel/overlaypanel.ts +++ b/src/app/components/overlaypanel/overlaypanel.ts @@ -8,6 +8,7 @@ import { ContentChildren, ElementRef, EventEmitter, + HostListener, Inject, Input, NgModule, @@ -422,6 +423,11 @@ export class OverlayPanel implements AfterContentInit, OnDestroy { this.hide(); event.preventDefault(); } + + @HostListener('document:keydown.escape', ['$event']) + onEscapeKeydown(event: KeyboardEvent) { + this.hide() + } onWindowResize() { if (this.overlayVisible && !DomHandler.isTouchDevice()) {