Good day
I’m using this datepicker and I like it but its not triggering the change event on an input after I click a date.
Here is my code
I tested this on jsFiddle
<input type="text" name="foo">
const elem = document.querySelector('input[name="foo"]');
const datepicker = new Datepicker(elem, {
autohide: true,
todayHighlight: true,
format: "yyyy-mm-dd",
});
elem.addEventListener("change", function (e) {
console.log(e.target.value);
});
When I click the specific date on the datepicker the change event is not triggered.
I need help with this.
I’m also using it with livewire and alpine but after clicking the date the change even is not triggered. here is my laravel code
When I tested pickaday it works.
How can I work around this or make it to trigger the change even on vanillajs datepicker.
Thanks in advance.