Skip to content

Commit 70687f7

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
1 parent 350e4ab commit 70687f7

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
@@ -882,26 +882,13 @@ $.extend(Datepicker.prototype, {
882882
_selectMonthYear: function(id, select, period) {
883883
var target = $(id);
884884
var inst = this._getInst(target[0]);
885-
inst._selectingMonthYear = false;
886885
inst['selected' + (period == 'M' ? 'Month' : 'Year')] =
887886
inst['draw' + (period == 'M' ? 'Month' : 'Year')] =
888887
parseInt(select.options[select.selectedIndex].value,10);
889888
this._notifyChange(inst);
890889
this._adjustDate(target);
891890
},
892891

893-
/* Restore input focus after not changing month/year. */
894-
_clickMonthYear: function(id) {
895-
var target = $(id);
896-
var inst = this._getInst(target[0]);
897-
if (inst.input && inst._selectingMonthYear) {
898-
setTimeout(function() {
899-
inst.input.focus();
900-
}, 0);
901-
}
902-
inst._selectingMonthYear = !inst._selectingMonthYear;
903-
},
904-
905892
/* Action for selecting a day. */
906893
_selectDay: function(id, month, year, td) {
907894
var target = $(id);
@@ -1610,7 +1597,6 @@ $.extend(Datepicker.prototype, {
16101597
var inMaxYear = (maxDate && maxDate.getFullYear() == drawYear);
16111598
monthHtml += '<select class="ui-datepicker-month" ' +
16121599
'onchange="DP_jQuery_' + dpuuid + '.datepicker._selectMonthYear(\'#' + inst.id + '\', this, \'M\');" ' +
1613-
'onclick="DP_jQuery_' + dpuuid + '.datepicker._clickMonthYear(\'#' + inst.id + '\');"' +
16141600
'>';
16151601
for (var month = 0; month < 12; month++) {
16161602
if ((!inMinYear || month >= minDate.getMonth()) &&
@@ -1644,7 +1630,6 @@ $.extend(Datepicker.prototype, {
16441630
endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear);
16451631
inst.yearshtml += '<select class="ui-datepicker-year" ' +
16461632
'onchange="DP_jQuery_' + dpuuid + '.datepicker._selectMonthYear(\'#' + inst.id + '\', this, \'Y\');" ' +
1647-
'onclick="DP_jQuery_' + dpuuid + '.datepicker._clickMonthYear(\'#' + inst.id + '\');"' +
16481633
'>';
16491634
for (; year <= endYear; year++) {
16501635
inst.yearshtml += '<option value="' + year + '"' +

0 commit comments

Comments
 (0)