Dialog: pass state to close snippet
This commit is contained in:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user