Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
Apache Flex 4.9.0
-
None
Description
Setting s:ComboBox#typicalItem produces unnecessarily long width. By contrast, s:DropDownList behaves as expected when setting its typicalItem property.
Sample application:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
minHeight="600"
minWidth="955">
<s:layout>
<s:VerticalLayout/>
</s:layout>
<fx:Script>
<![CDATA[
import mx.events.FlexEvent;
protected function cb_creationCompleteHandler(event:FlexEvent):void
{ cb.textInput.typicalText = "Avenir Next Condensed Demi Bold Italic"; } ]]>
</fx:Script>
<s:Label text="DropDownList works as expected"/>
<s:DropDownList requireSelection="true" typicalItem="Avenir Next Condensed Demi Bold Italic">
<s:dataProvider>
<s:ArrayList>
<fx:String>Avenir Next Condensed Demi Bold Italic</fx:String>
</s:ArrayList>
</s:dataProvider>
</s:DropDownList>
<s:Label text="ComboBox set to unnecesarily long width"/>
<s:ComboBox typicalItem="Avenir Next Condensed Demi Bold Italic">
<s:dataProvider>
<s:ArrayList>
<fx:String>Avenir Next Condensed Demi Bold Italic</fx:String>
</s:ArrayList>
</s:dataProvider>
</s:ComboBox>
<s:Label text="Workaround: set ComboBox#textInput#tipicalText"/>
<s:ComboBox id="cb" creationComplete="cb_creationCompleteHandler(event)">
<s:dataProvider>
<s:ArrayList>
<fx:String>Avenir Next Condensed Demi Bold Italic</fx:String>
</s:ArrayList>
</s:dataProvider>
</s:ComboBox>
</s:Application>