1

When I listen to flatpicker's on-close event and log v-model's value in the event function I get previously selected date

<flat-pickr v-model="myObject.happened_at" @on-close="onDateChange"></flat-pickr>
Sašo Kovačič
  • 891
  • 1
  • 9
  • 21

1 Answers1

2

Finally I found a solution for this problem. You have to listen on @input event

<flat-pickr v-model="myObject.happened_at" @input="onDateChange"></flat-pickr>

As I understand @on-change event is triggered before the v-model is updated so you get previous date instead of selected one.

Sašo Kovačič
  • 891
  • 1
  • 9
  • 21