diff options
author | Felix Nagel <info@felixnagel.com> | 2011-05-23 22:10:58 +0200 |
---|---|---|
committer | Felix Nagel <info@felixnagel.com> | 2011-05-23 22:10:58 +0200 |
commit | 6347f529e85aa1535bf8564f3ab6b7c39117c3f0 (patch) | |
tree | 2ac1dd3cc0916b54b6e94d267df1047593f726e8 /tests/unit/autocomplete/autocomplete_options.js | |
parent | d76aeef6de75896cfb147e3aa877a5e555273bc1 (diff) | |
parent | 23f222531d459e0fe38ddb4730ae060073d5d5c0 (diff) | |
download | jquery-ui-6347f529e85aa1535bf8564f3ab6b7c39117c3f0.tar.gz jquery-ui-6347f529e85aa1535bf8564f3ab6b7c39117c3f0.zip |
Merge commit '1.8.13' into selectmenu
Diffstat (limited to 'tests/unit/autocomplete/autocomplete_options.js')
-rw-r--r-- | tests/unit/autocomplete/autocomplete_options.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/unit/autocomplete/autocomplete_options.js b/tests/unit/autocomplete/autocomplete_options.js index 2800fbab8..6ec4b69f2 100644 --- a/tests/unit/autocomplete/autocomplete_options.js +++ b/tests/unit/autocomplete/autocomplete_options.js @@ -97,6 +97,27 @@ test( "appendTo", function() { ac.autocomplete( "destroy" ); }); +function autoFocusTest( afValue, focusedLength ) { + var ac = $( "#autocomplete" ).autocomplete({ + autoFocus: afValue, + delay: 0, + source: data, + open: function( event, ui ) { + equal( ac.autocomplete( "widget" ).children( ".ui-menu-item:first .ui-state-hover" ).length, focusedLength, "first item is " + afValue ? "" : "not" + " auto focused" ); + start(); + } + }); + ac.val( "ja" ).keydown(); + stop(); +} + +test( "autoFocus: false", function() { + autoFocusTest( false, 0 ); +}); + +test( "autoFocus: true", function() { + autoFocusTest( true, 1 ); +}); test("delay", function() { var ac = $("#autocomplete").autocomplete({ |