mdehoog / Semantic-UI-Calendar

Calendar module for Semantic UI
MIT License
805 stars 127 forks source link

Changing Value doesn't Trigger Change Event #49

Closed jtillman closed 7 years ago

jtillman commented 7 years ago

After user selects a value and the input value is update, the "change" event is not triggered on the input element.

As per jQuery documentation, you should manually call .trigger( "change" ) after setting a input's value.

Other frameworks rely on these events to update their state properly. In my case Angular 2.

mdehoog commented 7 years ago

Use the onChange method instead... it provides a JS date object instead of text which you'd have to parse yourself.

mrigdon-zz commented 7 years ago

Awesome library Michael, thanks! One thing:

This prevents you from simply using

$('form').change(() => {
  ...
})

to handle all form change events in forms where we use this datepicker.