nathanreyes / v-calendar

An elegant calendar and datepicker plugin for Vue.
https://vcalendar.io
MIT License
4.4k stars 861 forks source link

`inputValue` not initialized when not in min/max range #972

Open ThomasPoncet opened 3 years ago

ThomasPoncet commented 3 years ago

When the value provided to a date picker is not contained in the min/max dates range, this value is not used to initialize inputValue (slot property).

Here is a demo: https://codesandbox.io/s/billowing-forest-7lgqd?file=/src/App.vue

It prevents us displaying the value (formatted by the date picker) when not in the min/max range. Can you confirm that this is a bug?


If it's confirmed that this is a bug, I'd be happy to help to fix it if needed. (In this case, it would be helpful to have share short documentation on how to set up a local dev environment for this project: I maybe missed it.)

ThomasPoncet commented 3 years ago

A workaround can be not to use inputValue and format the value yourself. But the picker is still in a strange state in this case, and there is still a bug: when removing the value in the input, the component doesn't update the date to null.

(I've made a demo here, using intermediary input component https://codesandbox.io/s/romantic-hooks-fq57j?file=/src/App.vue)