diff --git a/components/calendar/dialog/CreateEvent.vue b/components/calendar/dialog/CreateEvent.vue index e53174f..ea87e02 100644 --- a/components/calendar/dialog/CreateEvent.vue +++ b/components/calendar/dialog/CreateEvent.vue @@ -38,6 +38,7 @@ function openEventCreatePopover() { function handleClosing(e: Event) { e.preventDefault() popoverOpen.value = false + setTimeout(() => resetSkeleton(), 100) } diff --git a/components/calendar/dialog/QuickCreateEvent.vue b/components/calendar/dialog/QuickCreateEvent.vue index a29c4ea..53f0446 100644 --- a/components/calendar/dialog/QuickCreateEvent.vue +++ b/components/calendar/dialog/QuickCreateEvent.vue @@ -2,11 +2,22 @@ import { PhPlus } from "@phosphor-icons/vue"; const isDialogOpen = ref(false); +const { resetSkeleton } = useCalendar(); // Toggles the dialog function toggleDialog() { isDialogOpen.value = !isDialogOpen.value; }; + +/** + * Prevents the modal from closing if's still loading + * + * @param e The closing event (can be keydown or click) + */ +function handleClosing(e: Event) { + e.preventDefault() + setTimeout(() => resetSkeleton(), 100) +}