Skip to content

Commit d434fcb

Browse files
authored
Merge pull request #34 from edwmurph/calendar
feat(PrimeCalendar): Support clearing value
2 parents 7326afb + fb8f595 commit d434fcb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/formkit/PrimeCalendar.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ function handleBlur(e: CalendarBlurEvent) {
2020
context?.handlers.blur(e.value)
2121
}
2222
23+
function handleClearClick() {
24+
context?.node.input(null)
25+
}
26+
2327
const styleClass = computed(() => (context?.state.validationVisible && !context?.state.valid) ? `${attrs.value?.class} p-invalid` : attrs.value?.class)
2428
</script>
2529

@@ -82,6 +86,7 @@ const styleClass = computed(() => (context?.state.validationVisible && !context?
8286
@date-select="handleSelect"
8387
@input="handleInput"
8488
@blur="handleBlur"
89+
@clear-click="handleClearClick"
8590
/>
8691
</div>
8792
</template>

0 commit comments

Comments
 (0)