I use the AutoComplete component regularly and I just noticed that it
breaks in Flex 3 Beta. I think the break must be due to a change in
the ComboBox code. Is there a way to find out what changed in
ComboBox from Flex 2 - 3?
Here is a test if you want to see the break.
Compile the following code in both Flex 2.0.1 and Flex 3 Beta 3.
- Type the letter "J" in the text box
- Select Jefferson City from the list
IN FLEX 2
Jefferson City will appear in the text input (and as selectedItem) as
expected.
IN FLEX 3
The dropdown will close without choosing Jefferson City
My workaround:
This is not a great option, but to get the component to work I
commented out line 429 (selectedIndex = 0;) so that it keep the
select at -1 until you physically click on something. This breaks
the look ahead feature, but I would rather turn that off for now and
still have the component work. There also seems to be a problem
with the selecttion caret but I haven't totally explored that to
figure out what is happening.
I don't know if anyone is still developing this component, but it is
very useful so hopefully someone can look at this.
- Kevin
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute"
xmlns:controls="com.adobe.flex.extras.controls.*">
<controls:AutoComplete dataProvider="{myAC}" labelField="data"
left="50" top="25"/>
<mx:ArrayCollection id="myAC">
<!-- Use an mx:Array tag to associate an id with the array. -->
<mx:Array id="myArray">
<mx:Object label="MI" data="Lansing"/>
<mx:Object label="MO" data="Jefferson City"/>
<mx:Object label="MA" data="Boston"/>
<mx:Object label="MT" data="Helena"/>
<mx:Object label="ME" data="Augusta"/>
<mx:Object label="MS" data="Jackson"/>
<mx:Object label="MN" data="Saint Paul"/>
</mx:Array>
</mx:ArrayCollection>
</mx:Application>