Skip to content

Commit

Permalink
Dialog: Keep focus inside dialog, even when dialog itself has focus.
Browse files Browse the repository at this point in the history
  • Loading branch information
jzaefferer committed Oct 24, 2012
1 parent 3a09a4a commit 513b6da
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ui/jquery.ui.dialog.js
Expand Up @@ -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;
}
Expand Down

0 comments on commit 513b6da

Please sign in to comment.