Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When leaving flatpickr, the minute component entered by keyboard is not accepted. #278

Open
jahrralf opened this issue Mar 21, 2023 · 3 comments
Assignees

Comments

@jahrralf
Copy link

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.x
  • Vue.js version : 3.2
  • Browser name and version : Chrome
  • This package version : 11.x.x

https://ankurk91.github.io/vue-flatpickr-component/ vs. https://flatpickr.js.org/examples/#datetime

Current behavior

When you open the flatpickr with datetime configuration for the first time, go to the minute field, enter with the keyboard a number, then click with mouse outside of the flatpicker, then on the flatpickr.js.org you will see the selected minute in the field. When you do the same with vue-flatpickr, you will see that the minute stays "00". When you do the same thing a second time, it works also with vue-flatpickr.

https://us02web.zoom.us/rec/share/VI_OEh1CWWg5EtDHZhZA6znLqQmRfiJ8i7EeaFbYJT3YUd7X-tSIVVPD-5FK9CYW.CEcnweqQ4SOJWZX0?startTime=1679414151000
Code: Jy2&Q@d*

Expected behavior

Also with vue-flatpicker a minute value, which is entered through keyboard, should be put into the form field when leaving the flatpickr.

Minimal reproduction of the problem with instructions

See above.

@ankurk91 ankurk91 self-assigned this Mar 21, 2023
@ankurk91
Copy link
Owner

This is happening because the component also listen to onClose event from flatpickr and updates the v-model.

The onClose event does not have updated values at that moment. and then the onInput event emits with updated values.

Something is strange happening here.

https://jsfiddle.net/ankurk91/jmxcrknt/125/

@jahrralf
Copy link
Author

OK, thanks for you first analysis. Is there anything we can do to prevent this behavior, like ignoring the onClose for example?

@ankurk91
Copy link
Owner

Removing onClose will introduce other issues. It was added for a reason. Trying to find that PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants