Description
Is your feature request related to a problem? Please describe.
I'm trying to implement a system where the value of the datepicker is the current date/time on the blur event, if there is no modelValue. Something like the following:
onUnfocus() {
if(this.model) return
const dateNow = new Date()
if(this.format === 'time')
return this.model = {
hours: dateNow.getHours(),
minutes: dateNow.getMinutes()
}
this.model = dateNow.toString()
}
The issue is that the update:modelValue event is only triggered with the user releases the focus of the datetime picker, and the if model is null because the picker is initially empty and the user starts writing something and releases focus, their text gets replaced with the current date.
Describe the solution you'd like
An easy way to fix this is to have access to the value of the text-input and check if that's empty instead of the model. Could be done through a text-change event.
Describe alternatives you've considered
Currently I have no alternative to overcome this problem.
Additional context
None