Skip to content
Permalink
Browse files

Datepicker: Fixed #5128 Datepicker opens when setDate called

  • Loading branch information
Keith Wood
Keith Wood committed Feb 6, 2010
1 parent 341dbce commit c16ed70b68298f83ae9107aad2f07461132d2aad
Showing with 5 additions and 5 deletions.
  1. +5 −5 ui/jquery.ui.datepicker.js
@@ -649,7 +649,7 @@ $.extend(Datepicker.prototype, {
if (!showAnim)
postProcess();
if (inst.input.is(':visible') && !inst.input.is(':disabled'))
inst.input[0].focus();
inst.input.focus();
$.datepicker._curInst = inst;
}
},
@@ -692,9 +692,9 @@ $.extend(Datepicker.prototype, {
'Class']('ui-datepicker-multi');
inst.dpDiv[(this._get(inst, 'isRTL') ? 'add' : 'remove') +
'Class']('ui-datepicker-rtl');
if (inst == $.datepicker._curInst && inst.input &&
if (inst == $.datepicker._curInst && $.datepicker._datepickerShowing && inst.input &&
inst.input.is(':visible') && !inst.input.is(':disabled'))
$(inst.input[0]).focus();
inst.input.focus();
},

/* Retrieve the size of left and top borders for an element.
@@ -845,7 +845,7 @@ $.extend(Datepicker.prototype, {
var target = $(id);
var inst = this._getInst(target[0]);
if (inst.input && inst._selectingMonthYear && !$.browser.msie)
inst.input[0].focus();
inst.input.focus();
inst._selectingMonthYear = !inst._selectingMonthYear;
},

@@ -889,7 +889,7 @@ $.extend(Datepicker.prototype, {
this._hideDatepicker();
this._lastInput = inst.input[0];
if (typeof(inst.input[0]) != 'object')
inst.input[0].focus(); // restore focus
inst.input.focus(); // restore focus
this._lastInput = null;
}
},

0 comments on commit c16ed70

Please sign in to comment.
You can’t perform that action at this time.