Describe the bug
Current Behaviour
The Dialog root component has props: onOpenChange and onOpenChangeComplete. These only fire when the sheet closes and not when it opens.
Try the code below to try for yourself.
<script lang="ts">
import { Dialog } from "bits-ui";
let isOpen = $state(false);
</script>
<button onclick={() => (isOpen = true)}>Open dialog</button>
<Dialog.Root
bind:open={isOpen}
onOpenChangeComplete={(open) => {
console.log("onOpenChangeComplete", open);
}}
onOpenChange={(open) => {
console.log("onOpenChange", open);
}}
>
<Dialog.Portal>
<Dialog.Overlay class="fixed inset-0 z-50 bg-black/20" />
<Dialog.Content
class="fixed right-3 top-3 z-50 h-[calc(100%-24px)] w-full max-w-[420px] rounded-2xl bg-background p-6 shadow-lg"
>
<Dialog.Title class="text-base font-semibold">Basic Dialog</Dialog.Title>
<p class="mt-2 text-sm">Simple open/close behavior.</p>
<button
class="mt-4 rounded border px-3 py-2"
onclick={() => (isOpen = false)}
>
Close dialog
</button>
</Dialog.Content>
</Dialog.Portal>
</Dialog.Root>
Expect Behaviour
I expect the logs to log when the dialog is opened, not just when it closes.
Reproduction
There is no stack blitz link in the dialog docs AFAICT https://bits-ui.com/docs/components/dialog
Logs
System Info
"svelte": "^5.55.0"
"bits-ui": "^2.16.3"
"@sveltejs/kit": "^2.50.0"
Severity
blocking an upgrade
Describe the bug
Current Behaviour
The
Dialogroot component has props:onOpenChangeandonOpenChangeComplete. These only fire when the sheet closes and not when it opens.Try the code below to try for yourself.
Expect Behaviour
I expect the logs to log when the dialog is opened, not just when it closes.
Reproduction
There is no stack blitz link in the dialog docs AFAICT https://bits-ui.com/docs/components/dialog
Logs
System Info
Severity
blocking an upgrade