mockup
mockup copied to clipboard
Datepicker pattern does not trigger a change event on main input after hidden input change
Reproduction steps:
- Create a form with date input using calendar widget, say date-of-birth
- Create a jQuery function that listen to all input change in the form, print all input values in the function
- Pick a date in the input, the listener will print the value of hidden input with latest value, and data-of-birth input with the old value
Investigation:
- When the date is selected, the hidden input value is changed, then the value of main input data-of-birth is updated programmatically via jQuery. The second change will not trigger the listener unless calling jQuery.trigger('change') for that input
Since the user is effectively changing the value and then both fields need to be triggered