Skip to content

Commit 4fcecdf

Browse files
committed
fix: use .matches() to stop navigation when the modal is open on the settings page
1 parent 8f56e14 commit 4fcecdf

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

app/pages/settings.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ onKeyStroke(
1010
'Escape',
1111
e => {
1212
const target = e.target as HTMLElement
13-
console.log(target)
14-
if (!['INPUT', 'SELECT', 'TEXTAREA', 'BUTTON'].includes(target?.tagName)) {
13+
if (
14+
!['INPUT', 'SELECT', 'TEXTAREA'].includes(target?.tagName) &&
15+
!document.documentElement.matches('html:has(:modal)')
16+
) {
1517
e.preventDefault()
1618
router.back()
1719
}

0 commit comments

Comments
 (0)