Skip to content

Commit

Permalink
fix deletion on v-slot clear icon
Browse files Browse the repository at this point in the history
  • Loading branch information
VachetVirginie committed Jul 30, 2024
1 parent e8c4a96 commit 07f9f69
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,11 @@ export default defineComponent({
this.inputValue = ''
this.$emit('update:model-value', null)
},
onClearInput() {
this.date = null
this.inputValue = ''
this.$emit('update:model-value', null)
},
async handleCut(event?: ClipboardEvent) {
if (event && event.clipboardData) {
this.inputValue = '';
Expand Down Expand Up @@ -562,6 +567,7 @@ export default defineComponent({
</script>

<template>
Date: {{ date }} - inputValue: {{ inputValue }}
<div class="vd-date-picker">
<!-- doc: https://vue3datepicker.com-->
<VueDatePicker
Expand Down Expand Up @@ -647,7 +653,7 @@ export default defineComponent({

<template v-slot:clear v-if="clearable" >
<VIcon
@click='onClear'
@click='onClearInput'
tabindex="-1"
aria-hidden="true"
>
Expand Down

0 comments on commit 07f9f69

Please sign in to comment.