aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2009-02-13 03:06:43 +0000
committerScott González <scott.gonzalez@gmail.com>2009-02-13 03:06:43 +0000
commit2916159a088f20eb33602d69c97b79792dd5c037 (patch)
treea19fdf7d1d16d322e910780581b6bf4e0348653a
parent16c0c8f2594234ad970fc22112d4752c3f1e467e (diff)
downloadjquery-ui-2916159a088f20eb33602d69c97b79792dd5c037.tar.gz
jquery-ui-2916159a088f20eb33602d69c97b79792dd5c037.zip
Dialog: Don't set focus to elements in the titlebar on open. Fixes #4126 - 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.
-rw-r--r--ui/ui.dialog.js8
1 files changed, 3 insertions, 5 deletions
diff --git a/ui/ui.dialog.js b/ui/ui.dialog.js
index f6cd5ac20..4cec0f7f3 100644
--- a/ui/ui.dialog.js
+++ b/ui/ui.dialog.js
@@ -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();