You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ X] Bug report => search github for a similar issue or PR before submitting
[ ] Feature request
[ ] Other, please describe
Tell about your platform
flatPickr version : ^4.6.6
Vue.js version : ~2.6.6
Browser name and version : Chrome Version 90.0.4430.72 (Official Build) (64-bit)
This package version : ~8.1.2
Current behavior
The v-model is changed from null to an empty string when popup is closed but nothing selected
Expected behavior
The v-model should remain as null
Minimal reproduction of the problem with instructions
1- Hydrate a vue-flatpikr v-model with null value
2- Focus the input
3- Blur the input and see how the property changes from null to ""
This behaviour gets some troubles with validation libraries such vee-validate, where a pristine flag is set to false if any field has changed its value.
The most common use case of this flag is to enable/disable submit button in a form, so when this scenario happens, the submit button becomes enabled despite no changes were made in regards to datepicker.
In addition, setting to null the v-model when the input already has a valid date is parsed as "" instead of null
In this sample there are 2 picker inputs, the first one always as null, showing the object type of value.
The second one has a valid date on mount, which changes its value to an empty string despite the button forces it to be null
I'm submitting a ... (check one with "x")
Tell about your platform
Current behavior
The v-model is changed from null to an empty string when popup is closed but nothing selected
Expected behavior
The v-model should remain as null
Minimal reproduction of the problem with instructions
1- Hydrate a vue-flatpikr v-model with
null
value2- Focus the input
3- Blur the input and see how the property changes from
null
to""
This behaviour gets some troubles with validation libraries such vee-validate, where a
pristine
flag is set to false if any field has changed its value.The most common use case of this flag is to enable/disable submit button in a form, so when this scenario happens, the submit button becomes enabled despite no changes were made in regards to datepicker.
Not sure if this is related to an old bug I've reported to bootstrap-vue developers, but the same was happening with the
<b-input>
component which was fixed in PR 6084.The text was updated successfully, but these errors were encountered: