From e4a04d44bd557782a7863d65d2835b61edd29931 Mon Sep 17 00:00:00 2001 From: mehm8128 Date: Mon, 13 Nov 2023 19:13:46 +0900 Subject: [PATCH] =?UTF-8?q?=E3=81=9D=E3=81=AE=E3=81=BE=E3=81=BEaddEventLis?= =?UTF-8?q?tener=E3=81=AB=E5=85=A5=E3=82=8C=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/ui/modal.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/store/ui/modal.ts b/src/store/ui/modal.ts index 80115d860..bb241d64f 100644 --- a/src/store/ui/modal.ts +++ b/src/store/ui/modal.ts @@ -148,13 +148,11 @@ const useModalStorePinia = defineStore('ui/modal', () => { } } - const onKeyDown = (e: KeyboardEvent) => { + window.addEventListener('keydown', e => { if (e.key === 'Escape' && shouldShowModal.value) { popModal() } - } - - window.addEventListener('keydown', onKeyDown) + }) return { isOnInitialModalRoute,