Skip to content

Commit

Permalink
Dialog: Don't set focus to elements in the titlebar on open. Fixes #4…
Browse files Browse the repository at this point in the history
…126 - focus on dialog open should be constrained to the contents of the dialog.

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.
  • Loading branch information
scottgonzalez committed Feb 13, 2009
1 parent 16c0c8f commit 2916159
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions ui/ui.dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit 2916159

Please sign in to comment.