diff options
author | Yermo Lamers <yml@yml.com> | 2014-02-04 16:47:26 -0500 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2014-07-24 17:00:55 -0400 |
commit | 930bc7df666c997add9978d3cc3139559e71ae77 (patch) | |
tree | bece8347ceeef2db3e852bde10e5a4346df0fc32 /tests/unit/autocomplete | |
parent | 5beae72e7773d35d46195a4359cb8f845dfb0f4f (diff) | |
download | jquery-ui-930bc7df666c997add9978d3cc3139559e71ae77.tar.gz jquery-ui-930bc7df666c997add9978d3cc3139559e71ae77.zip |
Autocomplete: ESCAPE should not change content of a MultiLine
Fixes #9790
Closes gh-1190
Diffstat (limited to 'tests/unit/autocomplete')
-rw-r--r-- | tests/unit/autocomplete/autocomplete_core.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/unit/autocomplete/autocomplete_core.js b/tests/unit/autocomplete/autocomplete_core.js index c306495f2..e8a3e5937 100644 --- a/tests/unit/autocomplete/autocomplete_core.js +++ b/tests/unit/autocomplete/autocomplete_core.js @@ -189,6 +189,34 @@ asyncTest( "past end of menu in multiline autocomplete", function() { }, 50 ); }); +asyncTest( "ESCAPE in multiline autocomplete", function() { + expect( 2 ); + + var customVal = "custom value", + element = $( "#autocomplete-contenteditable" ).autocomplete({ + delay: 0, + source: [ "javascript" ], + focus: function( event, ui ) { + equal( ui.item.value, "javascript", "Item gained focus" ); + $( this ).text( customVal ); + event.preventDefault(); + } + }); + + element + .simulate( "focus" ) + .autocomplete( "search", "ja" ); + + setTimeout(function() { + element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } ); + element.simulate( "keydown", { keyCode: $.ui.keyCode.ESCAPE } ); + equal( element.text(), customVal ); + start(); + }, 50 ); +}); + + + asyncTest( "handle race condition", function() { expect( 3 ); var count = 0, |