From d14366abcea59b4fb6d0fb1ce48a6ad196ddff3a Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Thu, 3 Feb 2011 08:51:50 -0500 Subject: [PATCH] =?utf8?q?Datepicker:=20only=20set=20the=20focus=20explici?= =?utf8?q?tly=20if=20it=20is=20not=20already=20on=20the=20target=20field.?= =?utf8?q?=20Fixed=20#6694=20=E2=80=93=20datepicker=20does=20not=20fire=20?= =?utf8?q?change=20event=20in=20IE8?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit jQuery stores the current content of a field whenever it gets the focus. Since the fixed function is also called for KeyUp events the change event is not triggered anymore when the input looses focus. (cherry picked from commit 39cf7d5bb4f9dfe1ada5dc2499f5c91e536ec96b) --- ui/jquery.ui.datepicker.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/jquery.ui.datepicker.js b/ui/jquery.ui.datepicker.js index 6b46dcfe2..018c6cf84 100644 --- a/ui/jquery.ui.datepicker.js +++ b/ui/jquery.ui.datepicker.js @@ -700,7 +700,9 @@ $.extend(Datepicker.prototype, { inst.dpDiv[(this._get(inst, 'isRTL') ? 'add' : 'remove') + 'Class']('ui-datepicker-rtl'); if (inst == $.datepicker._curInst && $.datepicker._datepickerShowing && inst.input && - inst.input.is(':visible') && !inst.input.is(':disabled')) + // #6694 - don't focus the input if it's already focused + // this breaks the change event in IE + inst.input.is(':visible') && !inst.input.is(':disabled') && inst.input[0] != document.activeElement) inst.input.focus(); // deffered render of the years select (to avoid flashes on Firefox) if( inst.yearshtml ){ -- 2.39.5