aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.datepicker.js
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2011-02-03 08:51:50 -0500
committerScott González <scott.gonzalez@gmail.com>2011-02-03 08:52:27 -0500
commitd14366abcea59b4fb6d0fb1ce48a6ad196ddff3a (patch)
tree4e819bef7bcdc6df996287d8be2f0747da047bff /ui/jquery.ui.datepicker.js
parentd6fa44a0b4c5bf08f31040f9008e8fb54b36db02 (diff)
downloadjquery-ui-d14366abcea59b4fb6d0fb1ce48a6ad196ddff3a.tar.gz
jquery-ui-d14366abcea59b4fb6d0fb1ce48a6ad196ddff3a.zip
Datepicker: only set the focus explicitly if it is not already on the target field. Fixed #6694 – datepicker does not fire change event in IE8
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)
Diffstat (limited to 'ui/jquery.ui.datepicker.js')
-rw-r--r--ui/jquery.ui.datepicker.js4
1 files changed, 3 insertions, 1 deletions
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 ){