mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Dialog: Keep focus inside dialog, even when dialog itself has focus.
This commit is contained in:
parent
3a09a4a0de
commit
513b6da641
4
ui/jquery.ui.dialog.js
vendored
4
ui/jquery.ui.dialog.js
vendored
@ -184,10 +184,10 @@ $.widget("ui.dialog", {
|
||||
first = tabbables.filter( ":first" ),
|
||||
last = tabbables.filter( ":last" );
|
||||
|
||||
if ( event.target === last[0] && !event.shiftKey ) {
|
||||
if ( ( event.target === last[ 0 ] || event.target === uiDialog[ 0 ] ) && !event.shiftKey ) {
|
||||
first.focus( 1 );
|
||||
return false;
|
||||
} else if ( event.target === first[0] && event.shiftKey ) {
|
||||
} else if ( ( event.target === first[ 0 ] || event.target === uiDialog[ 0 ] ) && event.shiftKey ) {
|
||||
last.focus( 1 );
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user