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(); } });