From: Jörn Zaefferer Date: Tue, 23 Oct 2012 14:47:59 +0000 (-0400) Subject: Dialog: Keep focus inside dialog, even when dialog itself has focus. X-Git-Tag: 1.10.0-beta.1~272 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=513b6da641941a54d17880e75d7558b53650f62f;p=jquery-ui.git Dialog: Keep focus inside dialog, even when dialog itself has focus. --- diff --git a/ui/jquery.ui.dialog.js b/ui/jquery.ui.dialog.js index b54cd971f..95b3d28a6 100644 --- a/ui/jquery.ui.dialog.js +++ b/ui/jquery.ui.dialog.js @@ -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; }