2 Replies Latest reply on Mar 31, 2011 4:03 PM by Flex harUI

    Spark ComboBox/TextArea focus interaction

    mattrichard Level 1

      I have a ComboBox set up to change the font size of the text in a TextArea.  If I set the ComboBox to return focus to the TextArea in its change event, it causes the ComboBox to require 2 clicks to make a selection.  Here's a simple application showing the behaviour that I'm seeeing:


      <?xml version="1.0" encoding="utf-8"?>
      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
           <fx:Script>     <![CDATA[
                     import flashx.textLayout.edit.IEditManager;
                     import flashx.textLayout.formats.TextLayoutFormat;
                     protected function sizeChange():void {
                          var format:TextLayoutFormat = new TextLayoutFormat();
                          format.fontSize = comboBox.selectedItem;
                          textArea.setFocus();  //Without this line, the combobox works as expected.  With it, you must click on your selection twice to close the combobox
           ]]>     </fx:Script>
                <s:TextArea id="textArea" />
                <s:ComboBox id="comboBox" change="sizeChange()">