Hi guys,

I have found a bug with the AutoComplete component, where it clears the text 
field if text is assigned programatically and the text is bigger than the 
default component size (21 characters).

The bug exists on line 520 of the class:

if(selectedIndex == -1)
textInput.text = typedText;


My fix (seems to work and haven't found any side effects yet):


if(selectedIndex == -1 && typedText)
textInput.text = typedText;


Another bug exists on line 559, where the selection caret is placed at the end 
of the text field when there is more than 21 characters in the text field and 
you try to add or delete characters inside the text field:


else if(typedText)
//Sets the selection when user navigates the suggestion list through
//arrows keys.
textInput.setSelection(_typedText.length,textInput.text.length);



My fix is to remove the setSelection() call:


else if(typedText){
//Sets the selection when user navigates the suggestion list through
//arrows keys.
//textInput.setSelection(_typedText.length,textInput.text.length);
}


I am unaware of any side-effects to this fix, but would be interested to hear 
other's opinions on this.

Cheers,
Adam

Reply via email to