Spark combobox issue in sdk 4.1.0

selected index 4 value shown in prompt textinput on up/down array key in dropdown

<s:ComboBox id=”myCB” width=”140″ color=”#000000″ requireSelection=”true”>
<s:dataProvider>
<mx:ArrayList>
<fx:String>Red</fx:String>
<fx:String>Orange</fx:String>
<fx:String>Yellow</fx:String>
<fx:String>Blue</fx:String>
<fx:String>Green</fx:String>
</mx:ArrayList>
</s:dataProvider>
</s:ComboBox>

Spark combobox shows value corresponding to selected index 4 but does not work with selected index 0 on down/up arrow key in dropdown

do not show value for selected index = 0 on down/up arrow key in dropdown

It is an issue in Flash builder 4.1.0 sdk and solved in 4.5 sdk.

ComboBox.as

override mx_internal function changeHighlightedSelection(newIndex:int, scrollToTop:Boolean = false):void
{
super.changeHighlightedSelection(newIndex, scrollToTop);

if (newIndex > 0)// new Index is not checked for 0th index
{
var item:Object = dataProvider ? dataProvider.getItemAt(newIndex) : undefined;
if (item)
{
var itemString:String = itemToLabel(item);
textInput.selectAll();
textInput.insertText(itemString);
textInput.selectAll();

userTypedIntoText = false;
}
}
}

In Flash builder 4.5 they solved by changing condition if (newIndex >= 0).

Found by Shailesh Kadam

 

Advertisements
  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: