Skip to content

Commit

Permalink
そのままaddEventListenerに入れた
Browse files Browse the repository at this point in the history
  • Loading branch information
mehm8128 committed Nov 13, 2023
1 parent e4038bb commit e4a04d4
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/store/ui/modal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit e4a04d4

Please sign in to comment.