]> source.dussan.org Git - jquery-ui.git/commitdiff
Dialog: Keep focus inside dialog, even when dialog itself has focus.
authorJörn Zaefferer <joern.zaefferer@gmail.com>
Tue, 23 Oct 2012 14:47:59 +0000 (10:47 -0400)
committerJörn Zaefferer <joern.zaefferer@gmail.com>
Wed, 24 Oct 2012 21:03:00 +0000 (17:03 -0400)
ui/jquery.ui.dialog.js

index b54cd971f3bcf12abfc90d392d12bf0034e5b3b0..95b3d28a625c9077b13e1945de6ca969a3f7f9fe 100644 (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;
                        }