From fb193ebc8deb01fa73ff78a5849af6250f5b03d3 Mon Sep 17 00:00:00 2001 From: marcneuwirth Date: Wed, 25 May 2011 05:38:53 +0000 Subject: [PATCH 1/2] Datepicker: Check if typeof input === 'object' Fixed #6669 - Datepicker: _selectDate restores focus to non-object --- ui/jquery.ui.datepicker.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/jquery.ui.datepicker.js b/ui/jquery.ui.datepicker.js index 4c73bdfd8e3..b42a82aa3aa 100644 --- a/ui/jquery.ui.datepicker.js +++ b/ui/jquery.ui.datepicker.js @@ -919,7 +919,7 @@ $.extend(Datepicker.prototype, { else { this._hideDatepicker(); this._lastInput = inst.input[0]; - if (typeof(inst.input[0]) != 'object') + if (typeof(inst.input[0]) === 'object') inst.input.focus(); // restore focus this._lastInput = null; } From 19debf2a1bd7b8c4189e4f229e3ebe7d84b41386 Mon Sep 17 00:00:00 2001 From: marcneuwirth Date: Tue, 14 Jun 2011 23:26:12 +0000 Subject: [PATCH 2/2] remove unnecessary if --- ui/jquery.ui.datepicker.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ui/jquery.ui.datepicker.js b/ui/jquery.ui.datepicker.js index b42a82aa3aa..1d98be0b1e9 100644 --- a/ui/jquery.ui.datepicker.js +++ b/ui/jquery.ui.datepicker.js @@ -919,8 +919,7 @@ $.extend(Datepicker.prototype, { else { this._hideDatepicker(); this._lastInput = inst.input[0]; - if (typeof(inst.input[0]) === 'object') - inst.input.focus(); // restore focus + inst.input.focus(); // restore focus this._lastInput = null; } },