mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Datepicker: only set the focus explicitly if it is not already on the target field. Fixed #6694 – datepicker does not fire change event in IE8
jQuery stores the current content of a field whenever it gets the focus. Since the fixed function is also called for KeyUp events the change event is not triggered anymore when the input looses focus.
This commit is contained in:
parent
8ac5da2315
commit
39cf7d5bb4
4
ui/jquery.ui.datepicker.js
vendored
4
ui/jquery.ui.datepicker.js
vendored
@ -700,7 +700,9 @@ $.extend(Datepicker.prototype, {
|
||||
inst.dpDiv[(this._get(inst, 'isRTL') ? 'add' : 'remove') +
|
||||
'Class']('ui-datepicker-rtl');
|
||||
if (inst == $.datepicker._curInst && $.datepicker._datepickerShowing && inst.input &&
|
||||
inst.input.is(':visible') && !inst.input.is(':disabled'))
|
||||
// #6694 - don't focus the input if it's already focused
|
||||
// this breaks the change event in IE
|
||||
inst.input.is(':visible') && !inst.input.is(':disabled') && inst.input[0] != document.activeElement)
|
||||
inst.input.focus();
|
||||
// deffered render of the years select (to avoid flashes on Firefox)
|
||||
if( inst.yearshtml ){
|
||||
|
Loading…
Reference in New Issue
Block a user