]> source.dussan.org Git - jquery-ui.git/commitdiff
Dialog: Don't set focus to elements in the titlebar on open. Fixes #4126 - focus...
authorScott González <scott.gonzalez@gmail.com>
Fri, 13 Feb 2009 03:06:43 +0000 (03:06 +0000)
committerScott González <scott.gonzalez@gmail.com>
Fri, 13 Feb 2009 03:06:43 +0000 (03:06 +0000)
NOTE: This breaks accessibility in Safari, which doesn't allow setting focus to elements that are not natively tabbable.  However, our current stance is that people who require accessibility will not be using Safari specifically for this type of reason.

ui/ui.dialog.js

index f6cd5ac2032c009a74aac069c7b664c3797a4600..4cec0f7f35ad9edc1a0e2e8933e1068763c6098a 100644 (file)
@@ -230,14 +230,12 @@ $.widget("ui.dialog", {
                        }
                }));
 
-               // set focus to the first tabbable element in:
-               // - content area
-               // - button pane
-               // - title bar
+               // set focus to the first tabbable element in the content area or the first button
+               // if there are no tabbable elements, set focus on the dialog itself
                $([])
                        .add(uiDialog.find('.ui-dialog-content :tabbable:first'))
                        .add(uiDialog.find('.ui-dialog-buttonpane :tabbable:first'))
-                       .add(uiDialog.find('.ui-dialog-titlebar :tabbable:first'))
+                       .add(uiDialog)
                        .filter(':first')
                        .focus();