aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2010-07-16 16:57:04 -0400
committerScott González <scott.gonzalez@gmail.com>2010-07-16 16:57:46 -0400
commit64d90b4a710d520a44408ccfa8df1100b0b95b4d (patch)
treef88bfa651d428074fd0c98f72c7ba8cde9a33cb2 /ui
parent9d01ab564525f9112c2488ad257637593062b70d (diff)
downloadjquery-ui-64d90b4a710d520a44408ccfa8df1100b0b95b4d.tar.gz
jquery-ui-64d90b4a710d520a44408ccfa8df1100b0b95b4d.zip
Dialog: Adjusted logic for finding the first tabbable element. Fixes #5767 - On open, the first tabbable element inside the dialog was never being focused in favor of the dialog container.
Diffstat (limited to 'ui')
-rw-r--r--ui/jquery.ui.dialog.js9
1 files changed, 3 insertions, 6 deletions
diff --git a/ui/jquery.ui.dialog.js b/ui/jquery.ui.dialog.js
index df896e7ea..ae96b2d8b 100644
--- a/ui/jquery.ui.dialog.js
+++ b/ui/jquery.ui.dialog.js
@@ -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;