Fix Modal
This commit is contained in:
@ -19,6 +19,7 @@
|
||||
|
||||
<script lang="ts">
|
||||
import {onMount} from "svelte";
|
||||
import {stopPropagation} from "@components/util.ts";
|
||||
|
||||
interface Props {
|
||||
title: string;
|
||||
@ -67,8 +68,8 @@
|
||||
})
|
||||
</script>
|
||||
|
||||
<dialog bind:this={dialog} onclose={close} oncancel={close} onclick={() => dialog.close()} aria-hidden="true" class="max-h-full max-w-md w-full rounded-lg shadow-lg dark:bg-neutral-800 dark:text-neutral-100">
|
||||
<div onclick={onclick} aria-hidden="true">
|
||||
<dialog bind:this={dialog} onclose={close} onclick={(e) => dialog.close()} aria-hidden="true" class="max-h-full max-w-md w-full rounded-lg shadow-lg dark:bg-neutral-800 dark:text-neutral-100">
|
||||
<div onclick={stopPropagation(onclick)} aria-hidden="true">
|
||||
<div class="p-6 border-b border-neutral-200 dark:border-neutral-700">
|
||||
<h1 class="text-4xl font-bold">{title}</h1>
|
||||
</div>
|
||||
|
||||
@ -24,3 +24,10 @@ export function window<T>(arr: T[], len: number): T[][] {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
export function stopPropagation(a: any) {
|
||||
return (e: Event) => {
|
||||
e.stopPropagation();
|
||||
a(e);
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user