mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
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.
This commit is contained in:
parent
9d01ab5645
commit
64d90b4a71
9
ui/jquery.ui.dialog.js
vendored
9
ui/jquery.ui.dialog.js
vendored
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user