Search and Top Navigation
#5629 closed bug (duplicate)
Opened May 18, 2010 12:28PM UTC
Closed July 16, 2010 09:14PM UTC
Dialog: first focusable element bug
| Reported by: | scottgonzalez | Owned by: | |
|---|---|---|---|
| Priority: | critical | Milestone: | 1.9.0 |
| Component: | ui.dialog | Version: | 1.8.1 |
| Keywords: | Cc: | ||
| Blocked by: | Blocking: |
Description
jQuery 1.4.2 now sorts when using .add(), which breaks the logic for finding the first focusable element in dialogs.
Encountered this bug too, have a hack to fix for now:
Old:
$([]) .add(uiDialog.find('.ui-dialog-content :tabbable:first')) .add(uiDialog.find('.ui-dialog-buttonpane :tabbable:first')) .add(uiDialog) .filter(':first') .focus();New:
var x = uiDialog; var y = uiDialog.find('.ui-dialog-content :tabbable:first'); var z = uiDialog.find('.ui-dialog-buttonpane :tabbable:first'); if(y.length) x = y; if(z.length) x = z; x.focus( );