Skip to content
Permalink
Browse files
Datepicker: use a setTimeout 0 so the same code can run in IE (as oth…
…er browsers) to set focus back to the datepicker text input if a month or year drop-down is clicked closed. Fixes #5897 - Datepicker: inconsistent behavior in IE when click to close month and year drop-downs
  • Loading branch information
rdworth committed Aug 4, 2010
1 parent 26b2d2d commit 85b8816
Showing 1 changed file with 5 additions and 2 deletions.
@@ -846,8 +846,11 @@ $.extend(Datepicker.prototype, {
_clickMonthYear: function(id) {
var target = $(id);
var inst = this._getInst(target[0]);
if (inst.input && inst._selectingMonthYear && !$.browser.msie)
inst.input.focus();
if (inst.input && inst._selectingMonthYear) {
setTimeout(function() {
inst.input.focus();
}, 0);
}
inst._selectingMonthYear = !inst._selectingMonthYear;
},

0 comments on commit 85b8816

Please sign in to comment.