-
Notifications
You must be signed in to change notification settings - Fork 102
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
setting onClose inside setDefaults is not working #165
Comments
I was able to re-produce it with vue component, the plain js flatpickr does respect the default configs. |
Thanks for the answer.
//libs/flatPickr/index.js
import Vue from 'vue'
import flatpickr from 'flatpickr'
import 'flatpickr/dist/flatpickr.css'
import 'flatpickr/dist/themes/material_blue.css'
import flatPickr from 'vue-flatpickr-component'
import { Indonesian } from 'flatpickr/dist/l10n/id.js'
flatpickr.localize(Indonesian)
flatpickr.setDefaults(
{
altInput: true,
altFormat: 'd-m-Y',
dateFormat: 'Y-m-d',
allowInput: true,
onClose: function(dates, currentdatestring, picker) {
console.log('close pickr')
}
}
)
Vue.use(flatPickr) Other defaults (altInput, altFormat, dateFormat and allowInput) is working and respected on every component, except onClose event. Please help me what should I do to configure it properly. |
Ya, i am aware of the issue, i need to give it more time, i may need to dig it more. |
@francsiswanto https://jsfiddle.net/g4acL78v/4/ The vue component injects its callback (local) which overrides the global one. |
v8.1.5 released |
Thank you |
After changing the version, still I am facing the issue. I have combination of Date and time. In order to change the date-time, the Date is working fine but when I change the time, hour change is applying on v-model value but minutes changes are not applying on close. |
Can u please create a production of the issue and write steps. |
I'm submitting a ... (check one with "x")
Tell about your platform
Current behavior
when I put event hook inside flatpickr.setDefaults like this:
the hook is not working, but if I put this event hook directly on component then is working nicely, like this:
Expected behavior
Please make it working on setDefault, so I don't have to refer to config in every component.
Thank you.
The text was updated successfully, but these errors were encountered: