]> source.dussan.org Git - jquery.git/commitdiff
Pre-focus the element so the browser won't fire focus while we're faking it.
authorDave Methvin <dave.methvin@gmail.com>
Mon, 14 Nov 2011 02:32:07 +0000 (21:32 -0500)
committerDave Methvin <dave.methvin@gmail.com>
Mon, 14 Nov 2011 02:32:07 +0000 (21:32 -0500)
At this point the unit test is only testing our ability to fake-fire focusin the right way. These machinations are related to the problem in #6705.

test/unit/event.js

index 8b3209733efc3e4f0b874289d22a2b0fbb777a16..70d616008a57b57c9225d1573d19dc4be687af35 100644 (file)
@@ -2324,6 +2324,9 @@ test("focusin bubbles", function() {
        var input = jQuery( "<input type='text' />" ).prependTo( "body" ),
                order = 0;
 
+       // focus the element so DOM focus won't fire
+       input[0].focus();
+
        jQuery( "body" ).bind( "focusin.focusinBubblesTest", function(){
                equal( 1, order++, "focusin on the body second" );
        });