From 513b6da641941a54d17880e75d7558b53650f62f Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=B6rn=20Zaefferer?= Date: Tue, 23 Oct 2012 10:47:59 -0400 Subject: [PATCH] Dialog: Keep focus inside dialog, even when dialog itself has focus. --- ui/jquery.ui.dialog.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; } -- 2.39.5