Vuepic / vue-datepicker

Datepicker component for Vue 3
https://vue3datepicker.com
MIT License
1.46k stars 145 forks source link

Improvement for the validation state of the calendar value #934

Closed snepsnepy closed 2 months ago

snepsnepy commented 3 months ago

Is your feature request related to a problem? Please describe.

First of all, hello to everybody😄

I used VueDatepicker component in my Nuxt3 app and I ran into this situation where I had to use "state" to set the red/green border based on some custom form validations. What I noticed is that when the page is loaded and there is no date selected, the border of the date input field is red.

Describe the solution you'd like

Regarding the solution, reading the contributing guidelines I understand that first it would be good to have a discussion about this and see if this might be considered an improvement.

Describe alternatives you've considered

In my opinion, it would feel more natural if the border was set to be red/green only if we have a selected date.

Jasenkoo commented 2 months ago

You need to set the value to null or undefined if the value is not validated (assuming you are using some form of validation). I will update to check only for the boolean type, but in any case, this is only a styling prop.