From 91547540aa0296d94c277327ffa2217ff9048311 Mon Sep 17 00:00:00 2001 From: Guiorgy Date: Tue, 18 Jul 2023 17:07:03 +0400 Subject: [PATCH] removed deprecated code removed `window.event`. replaced `keyCode` with `code`. --- docs/documentation/components/modal.html | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/documentation/components/modal.html b/docs/documentation/components/modal.html index cfa82a45..1d570f90 100644 --- a/docs/documentation/components/modal.html +++ b/docs/documentation/components/modal.html @@ -120,9 +120,7 @@ document.addEventListener('DOMContentLoaded', () => { // Add a keyboard event to close all modals document.addEventListener('keydown', (event) => { - const e = event || window.event; - - if (e.keyCode === 27) { // Escape key + if (event.code === 'Escape') { closeAllModals(); } });