aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.datepicker.js
diff options
context:
space:
mode:
authorRichard D. Worth <rdworth@gmail.com>2010-08-04 02:39:54 -0700
committerRichard D. Worth <rdworth@gmail.com>2010-08-04 02:39:54 -0700
commit85b8816fa9480005aedb3354714abbc1ead06897 (patch)
tree5632d0da86e05f0cdc2248882a32b5baa417dcff /ui/jquery.ui.datepicker.js
parent26b2d2d8671a79ea99ffee201545bc9342bec871 (diff)
downloadjquery-ui-85b8816fa9480005aedb3354714abbc1ead06897.tar.gz
jquery-ui-85b8816fa9480005aedb3354714abbc1ead06897.zip
Datepicker: use a setTimeout 0 so the same code can run in IE (as other 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
Diffstat (limited to 'ui/jquery.ui.datepicker.js')
-rw-r--r--ui/jquery.ui.datepicker.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/ui/jquery.ui.datepicker.js b/ui/jquery.ui.datepicker.js
index 6c4fda8e6..27ffadbff 100644
--- a/ui/jquery.ui.datepicker.js
+++ b/ui/jquery.ui.datepicker.js
@@ -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;
},