Flex AutoComplete Input Enter key Problem

From Adobe Flex Component  “AutoComplete Input” ,It doesnt work when use in FlashPlayer 10. Cannot use Enter Key to close drop down.

<strong>line 158:</strong>
/**
*  @private
*
*/
private var enterKeyDown:Boolean = false;
<strong>
</strong>
<strong>line 490:</strong>
else if(event.keyCode == Keyboard.ENTER)
{
     if(keepLocalHistory && dataProvider.length==0)
	addToLocalHistory();

     enterKeyDown = true; /** modified */
}
<strong>
</strong>
<strong>line 568:</strong>
if(showDropdown && !dropdown.visible && !enterKeyDown)  /** modified */
{
     //This is needed to control the open duration of the dropdown
    super.open();
    showDropdown = false;
    showingDropdown = true;

    if(dropdownClosed)
      dropdownClosed=false;
 }
 enterKeyDown = false;  /** modified */

Download here  AutoComplete.as

5 thoughts on “Flex AutoComplete Input Enter key Problem”

  1. Hello,thank you very much to solve the problem.But there are some other problems when you backward in autocomplete and select the dropdown again.I have solved the problem by focus out the autocomplete control when you press down the enter key.

  2. Amazing. Thanks alot.

    I spent 2 days trying to solve this thing.

    Finally. Thanks alot again.

Leave a Reply

Your email address will not be published. Required fields are marked *

5 × two =