Dialog: Keep focus inside dialog, even when dialog itself has focus.

This commit is contained in:
Jörn Zaefferer 2012-10-23 10:47:59 -04:00
parent 3a09a4a0de
commit 513b6da641

View File

@ -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;
}