From fb8f59514a2010e9d4776b888ac4fc7f20596307 Mon Sep 17 00:00:00 2001 From: edwmurph <20996513+edwmurph@users.noreply.github.com> Date: Wed, 31 Jan 2024 21:31:06 -0500 Subject: [PATCH] feat(PrimeCalendar): Support clearing value --- src/formkit/PrimeCalendar.vue | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/formkit/PrimeCalendar.vue b/src/formkit/PrimeCalendar.vue index fc26037d..4ce08500 100644 --- a/src/formkit/PrimeCalendar.vue +++ b/src/formkit/PrimeCalendar.vue @@ -20,6 +20,10 @@ function handleBlur(e: CalendarBlurEvent) { context?.handlers.blur(e.value) } +function handleClearClick() { + context?.node.input(null) +} + const styleClass = computed(() => (context?.state.validationVisible && !context?.state.valid) ? `${attrs.value?.class} p-invalid` : attrs.value?.class) @@ -82,6 +86,7 @@ const styleClass = computed(() => (context?.state.validationVisible && !context? @date-select="handleSelect" @input="handleInput" @blur="handleBlur" + @clear-click="handleClearClick" />