From df6110c0d424ff3306fdd5576011f2dcf4d242d0 Mon Sep 17 00:00:00 2001 From: Jörn Zaefferer Date: Fri, 21 Feb 2014 13:22:39 +0100 Subject: Core: Deprecate .focus( n ), replace in dialog with explicit timeouts Fixes #9646 --- ui/dialog.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'ui/dialog.js') diff --git a/ui/dialog.js b/ui/dialog.js index 07100c934..12dc1da65 100644 --- a/ui/dialog.js +++ b/ui/dialog.js @@ -342,10 +342,14 @@ return $.widget( "ui.dialog", { last = tabbables.filter( ":last" ); if ( ( event.target === last[0] || event.target === this.uiDialog[0] ) && !event.shiftKey ) { - first.focus( 1 ); + this._delay(function() { + first.focus(); + }); event.preventDefault(); } else if ( ( event.target === first[0] || event.target === this.uiDialog[0] ) && event.shiftKey ) { - last.focus( 1 ); + this._delay(function() { + first.focus(); + }); event.preventDefault(); } }, -- cgit v1.2.3