8000 v-model changing from null to an empty string when popup is closed but nothing selected · Issue #224 · ankurk91/vue-flatpickr-component · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Mar 14, 2025. It is now read-only.
This repository was archived by the owner on Mar 14, 2025. It is now read-only.
v-model changing from null to an empty string when popup is closed but nothing selected #224
@lucianobosco

Description

@lucianobosco

I'm submitting a ... (check one with "x")

[ 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.

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.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0