Skip to content

Commit

Permalink
Dialog: Adjusted logic for finding the first tabbable element. Fixes …
Browse files Browse the repository at this point in the history
…#5767 - On open, the first tabbable element inside the dialog was never being focused in favor of the dialog container.
  • Loading branch information
scottgonzalez committed Jul 16, 2010
1 parent 9d01ab5 commit 64d90b4
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions ui/jquery.ui.dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 64d90b4

Please sign in to comment.