Change event not raised when using datepicker in IE8

Change event not raised when using datepicker in IE8

When using IE8 and entering a date using the keyboard the change event isn't raised when the input loses focus if the datepicker was visible whilst entering the date.

Steps to reproduce:
  1. Use IE 8
  2. Focus the input field (datepicker should show).
  3. Enter the date "10/10/2010" in to the first input field (do not close the datepicker).
  4. Tab to the next input field.
Result:
The page still shows "Date: none"

Expected Result:
The page should show "Date: 10/10/2010"


Notes:
The field we are interested in is "Date:", "Other:" is just for verification that change and tabbing is working correctly.

The error seems to be coming from the focus changing during typing in the date box whilst the picker is visible. This happens when the user starts entering the year part of the date.




Stack trace when "_change_data" is changed due to focus event.
  1. jQuery.js:1174 (data == '10/10/2')
  2. jQuery.js:2636 (beforeactivate)
  3. jQuery.js:2260 (event.type == 'focus')
  4. ...
  5. jQuery-ui.js:7768 (_updateDatepicker, inst.input.focus())
  6. jQuery-ui.js:7651 (_doKeyUp)
Html:
  1. <div>
  2.     <input id="a1" type="text">
  3.     Date: <span id="a2">none</span>
  4. </div>

  5. <div>
  6.     <input id="b1" type="text">
  7.      Other: <span id="b2">none</span>
  8. </div>
Javascript:
  1. $(function () {  
  2.     $('#a1').datepicker ({
  3.         showOn: 'focus',
  4.         buttonText: 'clickme'
  5.     }).change (function () {
  6.         $('#a2').text ($(this).val ());
  7.     })
  8.     
  9.     $('#b1').change (function () {
  10.         $('#b2').text ($(this).val ());
  11.     })
  12. });