From ea8179ba648640a01a69179f7a1ff81545a03e93 Mon Sep 17 00:00:00 2001 From: Dergachev Mihail Date: Fri, 4 Oct 2024 17:22:40 +0300 Subject: [PATCH] fix event --- src/js/app/Popup.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/js/app/Popup.js b/src/js/app/Popup.js index 032e3e5..037b243 100644 --- a/src/js/app/Popup.js +++ b/src/js/app/Popup.js @@ -14,8 +14,7 @@ export default class Popup { this.openedPopups = []; document.body.addEventListener('keydown', (event) => { - console.log('event', ); - if (event.keyCode === 27) this.closeAll(); + if (event.key === 'Escape') this.closeAll(); }); document.body.addEventListener('click', (event) => {