I want to disable the auto-completing of text entered into a ComboBox, but still have it match the text against items in the DropDownList. Is there any easy way to do this?
Those "functionalities" are implemented by the
private function processInputField() and the
mx_internal function applySelection()
of the ComboBox component. They are either private of mx_internal so you can't override them. I created a new AS class that extends extends DropDownListBase and implements IIMESupport, just like the Spark ComboBox and tweaked the functions, for example I commented this lines:
Hope that helps!!
Simply create you new combobox class and override the findStringLoop function, it should always return -1 to prohibit the fincding of matching items (for autocomplete reasons).
Code is the following:
* Disabel the autocomplete option on Spark Combobox
mx_internal override function findStringLoop(str:String, startIndex:int, stopIndex:int):Number
The easiest solution for me was to use the existing itemMatchingFunction attribute on ComboBox and create a function like the one below retuning an empty Vector array:
protected function comboDisableMatchingFunction(comboBox:ComboBox, inputText:String):Vector.<int>
return new Vector.<int>();
Europe, Middle East and Africa