From 372f33cb21ea1ff59bbd431dbd6299c13b5443a7 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Fri, 12 Mar 2021 12:49:01 +0000 Subject: [PATCH] [Library | Trunk]: Fs modal: Fix esc key git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@60642 d315682c-612b-4755-9ff5-7f18f6832af3 --- utils/modal/full-screen-modal/full-screen-modal.component.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/utils/modal/full-screen-modal/full-screen-modal.component.ts b/utils/modal/full-screen-modal/full-screen-modal.component.ts index 844ceed0..26717cd6 100644 --- a/utils/modal/full-screen-modal/full-screen-modal.component.ts +++ b/utils/modal/full-screen-modal/full-screen-modal.component.ts @@ -50,7 +50,9 @@ export class FullScreenModalComponent implements OnInit { if (typeof document !== "undefined") { document.body.appendChild(this.element); this.subscriptions.push(fromEvent(document, 'keydown').pipe(delay(1)).subscribe((event: KeyboardEvent) => { - this.close(); + if(event.keyCode === 27) { + this.close(); + } })); } }