Skip to content

Commit 1d47956

Browse files
committed
Datepicker: Removed click handling for month and year dropdowns. Fixes #6198 - Datepicker Month and Year dropdowns in IE have to click twice.
Thanks jdufresne (cherry picked from commit 70687f7)
1 parent bd48ddf commit 1d47956

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

ui/jquery.ui.datepicker.js

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -878,26 +878,13 @@ $.extend(Datepicker.prototype, {
878878
_selectMonthYear: function(id, select, period) {
879879
var target = $(id);
880880
var inst = this._getInst(target[0]);
881-
inst._selectingMonthYear = false;
882881
inst['selected' + (period == 'M' ? 'Month' : 'Year')] =
883882
inst['draw' + (period == 'M' ? 'Month' : 'Year')] =
884883
parseInt(select.options[select.selectedIndex].value,10);
885884
this._notifyChange(inst);
886885
this._adjustDate(target);
887886
},
888887

889-
/* Restore input focus after not changing month/year. */
890-
_clickMonthYear: function(id) {
891-
var target = $(id);
892-
var inst = this._getInst(target[0]);
893-
if (inst.input && inst._selectingMonthYear) {
894-
setTimeout(function() {
895-
inst.input.focus();
896-
}, 0);
897-
}
898-
inst._selectingMonthYear = !inst._selectingMonthYear;
899-
},
900-
901888
/* Action for selecting a day. */
902889
_selectDay: function(id, month, year, td) {
903890
var target = $(id);
@@ -1603,7 +1590,6 @@ $.extend(Datepicker.prototype, {
16031590
var inMaxYear = (maxDate && maxDate.getFullYear() == drawYear);
16041591
monthHtml += '<select class="ui-datepicker-month" ' +
16051592
'onchange="DP_jQuery_' + dpuuid + '.datepicker._selectMonthYear(\'#' + inst.id + '\', this, \'M\');" ' +
1606-
'onclick="DP_jQuery_' + dpuuid + '.datepicker._clickMonthYear(\'#' + inst.id + '\');"' +
16071593
'>';
16081594
for (var month = 0; month < 12; month++) {
16091595
if ((!inMinYear || month >= minDate.getMonth()) &&
@@ -1637,7 +1623,6 @@ $.extend(Datepicker.prototype, {
16371623
endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear);
16381624
inst.yearshtml += '<select class="ui-datepicker-year" ' +
16391625
'onchange="DP_jQuery_' + dpuuid + '.datepicker._selectMonthYear(\'#' + inst.id + '\', this, \'Y\');" ' +
1640-
'onclick="DP_jQuery_' + dpuuid + '.datepicker._clickMonthYear(\'#' + inst.id + '\');"' +
16411626
'>';
16421627
for (; year <= endYear; year++) {
16431628
inst.yearshtml += '<option value="' + year + '"' +

0 commit comments

Comments
 (0)