aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit
diff options
context:
space:
mode:
authorCorey Frang <gnarf@gnarf.net>2011-08-02 16:54:24 -0500
committerCorey Frang <gnarf@gnarf.net>2011-08-02 16:54:24 -0500
commit8108ec82dbc1c203893db18aac827b93d48cfc07 (patch)
treeee11aa67dd2abe410361f53763766f1327361b19 /tests/unit
parent8fe87e288544204925265a4e7f19b7dfa24deed6 (diff)
downloadjquery-ui-8108ec82dbc1c203893db18aac827b93d48cfc07.tar.gz
jquery-ui-8108ec82dbc1c203893db18aac827b93d48cfc07.zip
Effects: Adding a check to retain focused elements after wrapping and unwrapping in animations - Fixes #7595 - Wrapper-creating jquery-ui animations will discard any focus state during the animation - Thanks @rubyruy
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/effects/effects_core.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/unit/effects/effects_core.js b/tests/unit/effects/effects_core.js
index 7c20e22fe..2b4d684eb 100644
--- a/tests/unit/effects/effects_core.js
+++ b/tests/unit/effects/effects_core.js
@@ -150,4 +150,15 @@ asyncTest( "animateClass clears style properties when stopped", function() {
start();
});
+test( "createWrapper and removeWrapper retain focused elements (#7595)", function() {
+ expect( 2 );
+ var test = $( "div.hidden" ).show(),
+ input = $( "<input>" ).appendTo( test ).focus();
+
+ $.effects.createWrapper( test );
+ equal( document.activeElement, input[ 0 ], "Active element is still input after createWrapper" );
+ $.effects.removeWrapper( test );
+ equal( document.activeElement, input[ 0 ], "Active element is still input after removeWrapper" );
+})
+
})(jQuery);