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:
- Use IE 8
- Focus the input field (datepicker should show).
- Enter the date "10/10/2010" in to the first input field (do not close the datepicker).
- Tab to the next input field.
Result:
The page still shows "Date: none"
Expected Result:
The page should show "Date: 10/10/2010"
Stack trace when "_change_data" is changed due to focus event.
- jQuery.js:1174 (data == '10/10/2')
- jQuery.js:2636 (beforeactivate)
- jQuery.js:2260 (event.type == 'focus')
- ...
- jQuery-ui.js:7768 (_updateDatepicker, inst.input.focus())
- jQuery-ui.js:7651 (_doKeyUp)
Html:
- <div>
- <input id="a1" type="text">
- Date: <span id="a2">none</span>
- </div>
- <div>
- <input id="b1" type="text">
- Other: <span id="b2">none</span>
- </div>
Javascript:
- $(function () {
- $('#a1').datepicker ({
- showOn: 'focus',
- buttonText: 'clickme'
- }).change (function () {
- $('#a2').text ($(this).val ());
- })
-
- $('#b1').change (function () {
- $('#b2').text ($(this).val ());
- })
- });