]> source.dussan.org Git - jquery-ui.git/commitdiff
Dialog: Adjusted logic for finding the first tabbable element. Fixes #5767 - On open...
authorScott González <scott.gonzalez@gmail.com>
Fri, 16 Jul 2010 20:57:04 +0000 (16:57 -0400)
committerScott González <scott.gonzalez@gmail.com>
Fri, 16 Jul 2010 20:57:46 +0000 (16:57 -0400)
ui/jquery.ui.dialog.js

index df896e7eafa8e769cd7d4e743b9b47f5f102c5a4..ae96b2d8b9a608d65b4b6c72307f214e257046bc 100644 (file)
@@ -324,12 +324,9 @@ $.widget("ui.dialog", {
 
                // 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)
-                       .filter(':first')
-                       .focus();
+               $(self.element.find(':tabbable').get().concat(
+                       uiDialog.find('.ui-dialog-buttonpane :tabbable').get().concat(
+                               uiDialog.get()))).eq(0).focus();
 
                self._trigger('open');
                self._isOpen = true;