mockup icon indicating copy to clipboard operation
mockup copied to clipboard

Datepicker pattern does not trigger a change event on main input after hidden input change

Open nngu6036 opened this issue 6 years ago • 1 comments

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

nngu6036 avatar Jan 31 '19 05:01 nngu6036

Since the user is effectively changing the value and then both fields need to be triggered

djay avatar Jan 31 '19 08:01 djay