Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-33381

Setting s:ComboBox#typicalItem produces unnecessarily long width

    XMLWordPrintableJSON

    Details

      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>

        Attachments

          Activity

            People

            • Assignee:
              aharui Alex Harui
              Reporter:
              jcfranco JC Franco
            • Votes:
              6 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: