huntabyte / shadcn-svelte

shadcn/ui, but for Svelte. ✨
https://next.shadcn-svelte.com
MIT License
5.48k stars 340 forks source link

bug: Dialog's closeOnOutsideClick no longer works with Svelte 5 update #1504

Closed weebao closed 26 minutes ago

weebao commented 1 hour ago

Describe the bug

As title. Props like closeOnOutsideClick and closeOnEscape from the primitive code in bits-ui no longer works after migrating to Svelte 5.

Reproduction

<Dialog.Root closeOnOutsideClick={true}>
    <Dialog.Content>
        <Dialog.Header>
            <Dialog.Title>Title</Dialog.Title>
            <Dialog.Description>
                Description
            </Dialog.Description>
        </Dialog.Header>
        Content
    </Dialog.Content>
</Dialog.Root>

Logs

No response

System Info

System:
    OS: Windows 10 10.0.26100
    CPU: (16) x64 AMD Ryzen 7 5800H with Radeon Graphics
    Memory: 1.90 GB / 13.86 GB
  Binaries:
    Node: 22.11.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 10.8.2 - C:\Program Files\nodejs\npm.CMD
    pnpm: 9.12.3 - ~\AppData\Local\pnpm\pnpm.EXE
  Browsers:
    Edge: Chromium (130.0.2849.80)
    Internet Explorer: 11.0.26100.1882

Severity

annoyance

ieedan commented 1 hour ago

I think what you want is now on the Content component and it's called interactOutsideBehavior="close" https://next.bits-ui.com/docs/components/dialog#api-reference

huntabyte commented 26 minutes ago

What @ieedan said 😃

weebao commented 19 minutes ago

Thank you!!