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

Change Event Fires Twice on Date Selection #121

Closed
pbtura opened this issue Jan 10, 2014 · 4 comments
Closed

Change Event Fires Twice on Date Selection #121

pbtura opened this issue Jan 10, 2014 · 4 comments

Comments

@pbtura
Copy link

pbtura commented Jan 10, 2014

Setting up a listener for 'change.dp' as shown in example 8 of the docs will result in the handler function being called twice. Since the second event dispatch lacks the 'date' property, any values being modified in the handler will be set to null.

The problem seems to be in the notifyChange() function (line 263). The call of picker.element.trigger() will dispatch the 'change.dp' event with the correct data. The subsequent call to picker.element.change() triggers the change event again, this time with the date property.

@Davidhidalgo
Copy link
Contributor

In my case i have a infinite bucle :S

@Eonasdan
Copy link
Owner

please check that latest version. I believe this issue has been fix. Closing this issue in favor of #117 .

@Eonasdan
Copy link
Owner

Check out the staging branch.

Please let me know if your issue has been resolved.

Eonasdan added a commit that referenced this issue Jan 25, 2014
Important! build.less file name has been been changed to
bootstrap-datetimepicker-build.less to prevent collisions

Fix for #135: setStartDate and setEndDate should now properly set.
Fix for #133: Typed in date now respects en/disabled dates
Fix for #132: En/disable picker function works again
Fix for #117, #119, #128, #121: double event change event issues should
be fixed
Fix for #112: change function no longer sets the input to a blank value
if the passed in date is invalid

Enhancement for #103: Increated the z-index of the widget
@joshcarr
Copy link

joshcarr commented Feb 5, 2014

I still see this issue on the staging branch and in build 2.1.32.

kikonen pushed a commit to kikonen/bootstrap-datetimepicker that referenced this issue Jan 2, 2017
@ghost ghost locked and limited conversation to collaborators Jun 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants