-
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
Limit the default events to be emitted #59
Comments
I've just started trying this out in my project and notice that each time a date is selected it emits 45 events. 42 on-day-create, 1 on-value-update, 1 on-change, and 1 input event. Needless to say this seems excessive. The 42 on-day-create events seems like a bug. I suspect it's because Vue is re-rendering the component and flatpickr sees this as a recreation and therefore calls an event for each day in the current calendar view. Perhaps there's a better way to suppress this. In fact on initial mount I'm seeing 130 events fire for one calendar. |
It is not a bug, it is a feature. |
Yeah, I read that.. however that's on onCreate event. Though it seems excessive imo, fair enough... however, that should only occur on the initial load of the calendar. These events are firing every time you change the date. To me that sounds like a bug. As in, the plugin should fire 42 on-day-create events when the calendar loads (and I suppose when changing months) but it shouldn't fire the onDayCreate event when selecting a date. I'll try a non Vue implementation and see if the same occurs. |
Hmm.. you were right that's how the plugin creators have designed it. Seems excessive. https://jsfiddle.net/1ns783ze/5/ |
closed with v7.0.0 |
@ankurk91 Just upgraded to 7.0.0 and can confirm this works as expected. Thanks for pushing that update 👍 |
Right now component listen to all events available in flatpickr, i want to reduce the events list.
Here is events list and i have marked the events i want to keep -
You will be able to override this via
:events="yourEventsList"
prop.The text was updated successfully, but these errors were encountered: