Skip to content

Commit aa79a53

Browse files
committed
fix(PrimeCalendar): does not trigger error when validation: 'required" on blur #22
1 parent 1d90b92 commit aa79a53

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/formkit/PrimeCalendar.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<script setup lang='ts'>
2+
import {CalendarBlurEvent} from "primevue/calendar";
3+
24
const props = defineProps({
35
context: Object,
46
})
@@ -14,6 +16,10 @@ function handleSelect(e: any) {
1416
context?.node.input(e)
1517
}
1618
19+
function handleBlur(e: CalendarBlurEvent) {
20+
context?.handlers.blur(e.value)
21+
}
22+
1723
const styleClass = computed(() => (context?.state.validationVisible && !context?.state.valid) ? `${attrs.value?.class} p-invalid` : attrs.value?.class)
1824
</script>
1925

@@ -75,6 +81,7 @@ const styleClass = computed(() => (context?.state.validationVisible && !context?
7581
:unstyled="attrs.unstyled ?? false"
7682
@date-select="handleSelect"
7783
@input="handleInput"
84+
@blur="handleBlur"
7885
/>
7986
</div>
8087
</template>

0 commit comments

Comments
 (0)