Open arctic-ice-cool opened 4 years ago
Hello, I've been looking for the same answer. Here it is for anyone looking: https://vcalendar.io/datepicker.html#require-selected-date
That doesn't solve the problem. I current have a date input that is optional but that default behavior of de-selecting the date when clicked a second time is simply not the expected behavior by the user, which is why this has been reported as a bug by our testing staff.
I would like the input to stay optional but that if the user selects the same date that is already selected, then nothing happens. I current have no work around.
Okay the problem seems to be here, DatePicker.vue#L603 where the code clears the value if the new value is the same as the previous value. It seem that there is an internal value named clearIfEqual
that already exists but current is only set as !isRequired
. That would perfect if we could just have a clearIfEqual prop directly on the component!
Also interested in this. Default behavior when it is not required feels weird to us, so would like to be able to change that.
Is it possible to disable the date selection toggle?
At the moment users can select a date using the picker, but if they reselect the same date it actually deselects it and nullifies / invalidates the date.
Is it possible to disable this behaviour?
Thanks!