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

Fix infinite loop with controlled components #14

Merged
merged 1 commit into from
Feb 28, 2017

Conversation

jacobmischka
Copy link
Collaborator

Because of this line in flatpickr, if you don't explicitly pass false to setDate it will trigger events, including the onChange event. This leads to an infinite loop when using this package as a controlled component.

Alternatively, I believe you can bind to onValueUpdate instead of onChange, that's what the vue version of this package does and it doesn't seem to suffer from this issue.

@haoxins haoxins merged commit ec796e1 into haoxins:master Feb 28, 2017
@haoxins
Copy link
Owner

haoxins commented Feb 28, 2017

thanks, v3.1.1 published :)

@jacobmischka
Copy link
Collaborator Author

jacobmischka commented Mar 21, 2017

Looks like this was fixed in flatpickr, so if you want to you can remove this now. It doesn't hurt anything to leave it in though. Thanks!

@ndinhphi
Copy link

ndinhphi commented Sep 3, 2017

@coderhaoxin could you please take a look #43. Thank you so much!

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.

3 participants