From 2445e20a856192179590c0d08e5d73479df1e52d Mon Sep 17 00:00:00 2001 From: Shannon Date: Wed, 23 Nov 2011 13:39:45 -0500 Subject: Autocomplete: Making sure we do not show search menu after a blur. Fixed #7423 - Tab out of autocomplete with remote source can leave menu showing. --- tests/unit/autocomplete/autocomplete_events.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'tests') diff --git a/tests/unit/autocomplete/autocomplete_events.js b/tests/unit/autocomplete/autocomplete_events.js index 286d902f1..d6a008ea2 100644 --- a/tests/unit/autocomplete/autocomplete_events.js +++ b/tests/unit/autocomplete/autocomplete_events.js @@ -157,6 +157,25 @@ asyncTest( "cancel select", function() { }, 50 ); }); +asyncTest( "blur during remote search", function() { + expect( 1 ); + var ac = $( "#autocomplete" ).autocomplete({ + delay: 0, + source: function( request, response ) { + ok( true, "trigger request" ); + ac.simulate( "blur" ); + setTimeout(function() { + response([ "result" ]); + start(); + }, 100 ); + }, + open: function() { + ok( false, "opened after a blur" ); + } + }); + ac.val( "ro" ).keydown(); +}); + /* TODO previous fix broke more than it fixed, disabling this for now - messed up regular menu select event test("blur without selection", function() { expect(1); -- cgit v1.2.3