From 90caa93a9b4b9b894b055cfb8dae0661ac7788b0 Mon Sep 17 00:00:00 2001 From: Scott González Date: Fri, 30 Jul 2010 12:59:33 -0400 Subject: Autocomplete: Respect the disabled option. Fixes #5619 - Autocomplete widget keeps looking for remote data even when it's disabled. --- tests/unit/autocomplete/autocomplete_options.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'tests/unit/autocomplete') diff --git a/tests/unit/autocomplete/autocomplete_options.js b/tests/unit/autocomplete/autocomplete_options.js index ac4aeef35..2800fbab8 100644 --- a/tests/unit/autocomplete/autocomplete_options.js +++ b/tests/unit/autocomplete/autocomplete_options.js @@ -116,6 +116,24 @@ test("delay", function() { }, 100); }); +test("disabled", function() { + var ac = $("#autocomplete").autocomplete({ + source: data, + delay: 0, + disabled: true + }); + ac.val("ja").keydown(); + + same( $(".ui-menu:visible").length, 0 ); + + stop(); + setTimeout(function() { + same( $(".ui-menu:visible").length, 0 ); + ac.autocomplete("destroy"); + start(); + }, 50); +}); + test("minLength", function() { var ac = $("#autocomplete").autocomplete({ source: data -- cgit v1.2.3