Skip to content
Browse files
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 39cf7d5)
  • Loading branch information
tobiasbrunner authored and scottgonzalez committed Feb 3, 2011
1 parent d6fa44a commit d14366abcea59b4fb6d0fb1ce48a6ad196ddff3a
Showing with 3 additions and 1 deletion.
  1. +3 −1 ui/jquery.ui.datepicker.js
@@ -700,7 +700,9 @@ $.extend(Datepicker.prototype, {
inst.dpDiv[(this._get(inst, 'isRTL') ? 'add' : 'remove') +
if (inst == $.datepicker._curInst && $.datepicker._datepickerShowing && inst.input &&':visible') && !':disabled'))
// #6694 - don't focus the input if it's already focused
// this breaks the change event in IE':visible') && !':disabled') && inst.input[0] != document.activeElement)
// deffered render of the years select (to avoid flashes on Firefox)
if( inst.yearshtml ){

0 comments on commit d14366a

Please sign in to comment.