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

Prevent error due to onChange firing after destroy() is called #1434

Merged
merged 1 commit into from
Jul 9, 2018

Conversation

IceCreamYou
Copy link
Contributor

If destroy() is called on a flatpickr instance after it closes but before the 300ms onChange timeout, then triggerEvent will throw an error when it eventually looks for onChange hooks, because destroy() removes the config. This PR fixes that problem.

The onChange event can fire when a flatpickr instance closes. Calling destroy() on the instance removes the `config can be delayed by 300ms
@chmln
Copy link
Member

chmln commented Jul 9, 2018

Great work, thanks @IceCreamYou ! 👍

@chmln chmln merged commit 7e66ed0 into flatpickr:master Jul 9, 2018
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

Successfully merging this pull request may close these issues.

None yet

2 participants