Modal noOutsideClick prop
This commit is contained in:
parent
69d022a2fa
commit
bd9fcf74c7
|
@ -6,6 +6,7 @@
|
|||
export let open: boolean;
|
||||
export let title: string;
|
||||
export let size: 'sm' | 'md' | 'lg' = 'md';
|
||||
export let noOutsideClick: boolean = false;
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
|
||||
|
@ -34,7 +35,7 @@
|
|||
</script>
|
||||
|
||||
<svelte:window on:keyup={escape} />
|
||||
<dialog {open} on:click={close} class="app-modal">
|
||||
<dialog {open} on:click={() => (!noOutsideClick ? close() : null)} class="app-modal">
|
||||
<article style:--max-width={maxWidths[size]} on:click|stopPropagation>
|
||||
<header>
|
||||
{title}
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
}
|
||||
</script>
|
||||
|
||||
<Modal title="Welcome!" size="sm" bind:open on:close={close}>
|
||||
<Modal title="Welcome!" size="sm" noOutsideClick={true} bind:open on:close={close}>
|
||||
<p>
|
||||
Capture your thoughts for later by writing a quick note. Add tags to categorize it and organize
|
||||
your notes.
|
||||
|
|
Loading…
Reference in New Issue