Skip to content

Prevent @interact-outside #95

@affemaen

Description

@affemaen

Hi, I'm using Sonner (https://github.com/xiaoluoboding/vue-sonner) and Drawer(vaul-vue) from shadcn-vue.

I'm trying to prevent interact-outside if a Sonner toast is clicked.

Like explained here

Examples
Sonner with Dialog
https://www.shadcn-vue.com/docs/components/sonner.html

`
<DrawerContent
....
@interact-outside="event => {
const target = event.target as HTMLElement;
if (target?.closest('[data-sonner-toaster]')) return event.preventDefault()
}"

`

But the drawer is still closed . I can se that the emitted event is prevented using the debugger. I've also tried using @pointer-down-outside without any success.

Any advice on how I can prevent the drawer from being closed when clicking on a Sonner toast?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions