]> source.dussan.org Git - jquery-ui.git/commitdiff
Datepicker: Fixed #5052 Set focus error in IE8 for disabled and hidden elements
authorKeith Wood <kbwood.au@gmail.com>
Mon, 25 Jan 2010 08:20:28 +0000 (08:20 +0000)
committerKeith Wood <kbwood.au@gmail.com>
Mon, 25 Jan 2010 08:20:28 +0000 (08:20 +0000)
ui/jquery.ui.datepicker.js

index 6e5fe8b00306c5ef3abf7e71e1b4d3bc8a58c075..ffd20db2d0f376a0d623d51c38af64f282f28896 100644 (file)
@@ -647,7 +647,7 @@ $.extend(Datepicker.prototype, {
                                inst.dpDiv[showAnim || 'show']((showAnim ? duration : null), postProcess);
                        if (!showAnim)
                                postProcess();
-                       if (inst.input[0].type != 'hidden')
+                       if (inst.input.is(':visible') && !inst.input.is(':disabled'))
                                inst.input[0].focus();
                        $.datepicker._curInst = inst;
                }
@@ -691,7 +691,8 @@ $.extend(Datepicker.prototype, {
                        'Class']('ui-datepicker-multi');
                inst.dpDiv[(this._get(inst, 'isRTL') ? 'add' : 'remove') +
                        'Class']('ui-datepicker-rtl');
-               if (inst.input && inst.input[0].type != 'hidden' && inst == $.datepicker._curInst)
+               if (inst == $.datepicker._curInst && inst.input &&
+                               inst.input.is(':visible') && !inst.input.is(':disabled'))
                        $(inst.input[0]).focus();
        },