Dialog: pass state to close snippet

This commit is contained in:
Elijah Duffy
2026-04-15 17:06:08 -07:00
parent 9f19a36994
commit 7e6fdc4071

View File

@@ -126,7 +126,7 @@
/** Sets bottom alignment of controls (default: end) */
controlsAlign?: 'start' | 'center' | 'end';
/** Top-right close control */
close?: Snippet | Omit<DialogControlButton, 'label'> | null;
close?: Snippet<[state: DialogState]> | Omit<DialogControlButton, 'label'> | null;
/**
* Callback when the dialog is opened
* @deprecated use onopenchange instead and check the open parameter
@@ -319,7 +319,7 @@
<!-- Close Button -->
{#if close !== null}
{#if typeof close === 'function'}
{@render close()}
{@render close(getState())}
{:else}
{@render dialogCloseButton(getState(), close)}
{/if}