Skip to content
This repository was archived by the owner on Mar 14, 2025. It is now read-only.

Missing flatpickr-input class due to vue removing dynamically added flatpickr-input class #284

Description

@lk77

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

[X] Bug report
[ ] Feature request
[ ] Other, please describe

Tell about your platform

  • flatPickr version : 4.6.13
  • Vue.js version : 3.2.31
  • Browser name and version : Chromium 117
  • This package version : 11.0.3

Current behavior

At the start of the page the flatpickr-input class is present, but is removed by vue on value update

Expected behavior

The flatpickr-input class stays on the input after value update

Minimal reproduction of the problem with instructions

it's linked to a :class i have on the picker which add/remove a is-invalid class, it trigger a re-render of the component, which removes the flatpickr-input class because vue does not know about it

i have a reproduction url : https://vue-s86h7j.stackblitz.io
editor: https://stackblitz.com/edit/vue-s86h7j?file=src%2FApp.vue

at the start the background is green, which means the flatpickr-input class is present,
when choosing a date, the background should turn white which means flatpickr-input class was removed by vue when applying the custom class from :class

i think the flatpickr-input class should be added to the input in the render function here : https://github.com/ankurk91/vue-flatpickr-component/blob/main/src/component.ts

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions