-
Notifications
You must be signed in to change notification settings - Fork 957
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Description
I noticed there can be some conflicts between <UNotifications /> and headless ui's dialogs. This makes it so toasts can't be closed when a <UModal /> is up. I'm not sure how to best solve this since it seems like it's more-so because of headless ui's focus trapping, but I've had some luck with changing where I mount <UNotifications /> so it's teleported to the body
<Teleport to="body">
<UNotifications />
</Teleport>Stackblitz for this: https://stackblitz.com/edit/nuxt-ui-vyjawz?file=pages%2FwithTeleport.vue
pages/index.vuemimics the current docs recommendationpages/withTeleport.vueteleports<UNotifications />to the body (allows you to click the close button but can't tab to it)pages/withOpenDialog.vuehas some rough ideas for dealing with headless ui's focus management. I'm pretty much just conditionally rendering the primary<UNotifications />based off the modal being open and toasts existing, but it's pretty hacky and jumpy
Additional context
No response
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request