fix(Toast): unreachable behind overlays (#2650)

Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
Sandro Circi
2024-11-15 11:59:08 +01:00
committed by GitHub
parent 756f791a1a
commit 0daac5bafb
3 changed files with 15 additions and 3 deletions

View File

@@ -101,7 +101,13 @@ const contentEvents = computed(() => {
}
}
return {}
return {
interactOutside: (e: Event) => {
if (e.target instanceof Element && e.target.closest('[data-sonner-toaster]')) {
return e.preventDefault()
}
}
}
})
const appConfig = useAppConfig()

View File

@@ -100,7 +100,13 @@ const contentEvents = computed(() => {
}
}
return {}
return {
interactOutside: (e: Event) => {
if (e.target instanceof Element && e.target.closest('[data-sonner-toaster]')) {
return e.preventDefault()
}
}
}
})
const appConfig = useAppConfig()