Don't send input event on programmaticly change date
See original GitHub issueI’m submitting a …
[X] Bug report => search github for a similar issue or PR before submitting
[ ] Feature request
[ ] Other, please describe
- flatPickr version : 4.2.4
- Vue.js version : 2.5.13
- Browser name and version : Chrome 63.0.3239.132
- This package version : 6.2.0
Current behavior When updating a date programatically, it sends an input event
Expected behavior It shouldn’t send an input event
Minimal reproduction of the problem with instructions I don’t think it should send back an input event. We already know that…
Here for the setDate
, the second parameter should be false https://github.com/ankurk91/vue-flatpickr-component/blob/master/src/component.vue#L132
Imagine I’ve a dropdown to select pre-defined dates, and I’ve a custom entry for custom date. When I listen for input event, I set the dropdown value to custom, and after the datepicker fire an event, which make the dropdown do it’s thing and so on.
I believe that this date change should be done silently.
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
javascript - Solution for on change doesn't work when input is ...
The onchange event only fires if the user changes the value of the input. It isn't supposed to fire if the input is...
Read more >HTMLElement: change event - Web APIs | MDN
When the user commits the change explicitly (e.g., by selecting a value from a <select> 's dropdown with a mouse click, by selecting...
Read more >lightning-record-edit-form - Salesforce Developers
If you capture the submit event and submit the form programmatically, use event.preventDefault() to cancel the default behavior of the event. This prevents...
Read more >SCR19: Using an onchange event on a select element ... - W3C
The objective of this technique is to demonstrate how to correctly use an onchange event with a select element to update other elements...
Read more >Form <input> elements must have labels | Axe Rules
Sign up for the axe newsletter. Stay up to date on axe features, updates, and events. ... Programmatically associate labels with all form...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Your second fiddle is your custom flatpickr component. You are not taking care of two way sync. Your second fiddle does not update the DOM (flatpickr instance), it only update the v-model.
I have already explained why this component always fires
change
event, see my above comment.Feel free to fork, copy this component and use in your project.
Change events works when user change date using picker, that is fine.
I would like to have a second option. Is it possible using this pluggin?