Open sofuxro opened 6 years ago
I am also having this same issue,
I tried adding a click event in addition to the data-clear like so (primitive example):
<a class="button" data-clear @click="clearDate"><i class="fa fa-close"></i></a>
...
clearDate() {
this.date = ''
}
this actually updated the data to the value I wanted, but visually it would clear and then the date would somehow reappear even though the data properties value was now an empty string. If you try this method you will have to click twice to remove it from the UI as well. Nevertheless, I would like to implement this in a cleaner way and using the default API that flatpickr offers.
Agreed this is annoying but you can do something like
clearDatePicker () {
this.$emit('input', null)
this.$nextTick(() => {
this.$refs['field'].datepicker.clear()
})
},
I have the datepicker wrapped in my own control
I've tried this:
(it does remove it from the input but the date persists in the model => the user doesn't see a date anymore, but the code still has it)
I saw that flickr (the one implemented here) can delete dates with Backspace. On this datepicker I can't do that either.
Am I missing something ? how can I set my startAt to null or empty string