|
@@ -1,12 +1,11 @@
|
|
|
<script lang="ts">
|
|
|
import { onMount, getContext, createEventDispatcher } from 'svelte';
|
|
|
- import { fade } from 'svelte/transition';
|
|
|
const i18n = getContext('i18n');
|
|
|
+ const dispatch = createEventDispatcher();
|
|
|
|
|
|
+ import { fade } from 'svelte/transition';
|
|
|
import { flyAndScale } from '$lib/utils/transitions';
|
|
|
|
|
|
- const dispatch = createEventDispatcher();
|
|
|
-
|
|
|
export let title = '';
|
|
|
export let message = '';
|
|
|
|
|
@@ -27,6 +26,12 @@
|
|
|
console.log('Escape');
|
|
|
show = false;
|
|
|
}
|
|
|
+
|
|
|
+ if (event.key === 'Enter') {
|
|
|
+ console.log('Enter');
|
|
|
+ show = false;
|
|
|
+ dispatch('confirm', inputValue);
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
onMount(() => {
|
|
@@ -56,7 +61,7 @@
|
|
|
}}
|
|
|
>
|
|
|
<div
|
|
|
- class=" m-auto rounded-2xl max-w-full w-[32rem] mx-2 bg-gray-50 dark:bg-gray-950 max-h-[100dvh] shadow-3xl border border-gray-850"
|
|
|
+ class=" m-auto rounded-2xl max-w-full w-[32rem] mx-2 bg-gray-50 dark:bg-gray-950 max-h-[100dvh] shadow-3xl"
|
|
|
in:flyAndScale
|
|
|
on:mousedown={(e) => {
|
|
|
e.stopPropagation();
|