This commit is contained in:
Timothy Jaeryang Baek
2026-07-01 02:49:33 -05:00
parent 650b817925
commit 0016266c06
2 changed files with 9 additions and 5 deletions
@@ -47,7 +47,7 @@
const handleKeyDown = (event: KeyboardEvent) => {
if (event.key === 'Escape') {
console.log('Escape');
show = false;
cancelHandler();
}
if (event.key === 'Enter') {
@@ -65,6 +65,11 @@
dispatch('confirm', _inputValue);
};
const cancelHandler = () => {
show = false;
dispatch('cancel');
};
onMount(() => {
mounted = true;
});
@@ -107,7 +112,7 @@
class=" fixed top-0 right-0 left-0 bottom-0 bg-black/60 w-full h-screen max-h-[100dvh] flex justify-center z-99999999 overflow-hidden overscroll-contain"
in:fade={{ duration: 10 }}
on:mousedown={() => {
show = false;
cancelHandler();
}}
>
<div
@@ -174,8 +179,7 @@
<button
class="text-sm bg-gray-100 hover:bg-gray-200 text-gray-800 dark:bg-gray-850 dark:hover:bg-gray-800 dark:text-white font-medium w-full py-2 rounded-3xl transition"
on:click={() => {
show = false;
dispatch('cancel');
cancelHandler();
}}
type="button"
>