     override public function setFocus():void
     {
         if (stage)
-        {
-            stage.focus = textInput.textDisplay;
+        {            
+            stage.focus = textInput.textDisplay;            
+        }
+    }
+    
+    /**
+     *  @private
+     */
+    override protected function isOurFocus(target:DisplayObject):Boolean
+    {
+        return target == textInput.textDisplay;
+    }
+    
+    /**
+     *  @private
+     */
+    override protected function focusInHandler(event:FocusEvent):void
+    {
+        super.focusInHandler(event);
+        
+        // Since the API ignores the visual editable and selectable 
+        // properties make sure the selection should be set first.
+        if (textInput && 
+            (textInput.editable || textInput.selectable))
+        {
+            // Workaround RET handling the mouse and performing its own selection logic
+            callLater(textInput.selectAll);
+        }
+        
+        userTypedIntoText = false;
+    }
+    
+    /**
+     *  @private
+     */
+    override protected function focusOutHandler(event:FocusEvent):void
+    {
+        // always commit the selection if we focus out        
+        if (!isDropDownOpen)
+        {
+            if (textInput.text != itemToLabel(selectedItem))
+                applySelection();
+        }
             
-            // Since the API ignores the visual editable and selectable 
-            // properties make sure the selection should be set first.
-            if (textInput.textDisplay && 
-                (textInput.textDisplay.editable || textInput.textDisplay.selectable))
+        super.focusOutHandler(event);
+    }
+    
+    /**
+     *  @private
+     */
+    override mx_internal function dropDownController_openHandler(event:DropDownEvent):void
+    {
+        super.dropDownController_openHandler(event);
+        
+        // If the user typed in text, start off by not showing any selection
+        // If this does match, then processInputField will highlight the match
+        userProposedSelectedIndex = userTypedIntoText ? NO_SELECTION : selectedIndex;  
+    }
+    
+    /**
+     *  @private 
+     */ 
+    override protected function dropDownController_closeHandler(event:DropDownEvent):void
+    {        
+        super.dropDownController_closeHandler(event);      
+        
+        // Commit the textInput text as the selection
+        if (!event.isDefaultPrevented())
+        {
+            applySelection();
+        }
+    }
+    
+    //--------------------------------------------------------------------------
+    //
+    //  Event Handlers
+    //
+    //--------------------------------------------------------------------------
+    
+    /**
+     *  @private 
+     */ 
+    private function textInput_focusInHandler(event:FocusEvent):void
+    {
+        isTextInputInFocus = true;
+    }
+    
+    /**
+     *  @private 
+     */ 
+    private function textInput_focusOutHandler(event:FocusEvent):void
+    {
+        isTextInputInFocus = false;
+    }
+    
+    /**
+     *  @private 
+     */ 
+    protected function textInput_changeHandler(event:TextOperationEvent):void
+    {  
+    
+        userTypedIntoText = true;
+        
+        //var ito:InsertTextOperation = event.operation as InsertTextOperation;
+        
+        //trace("CB.textInput_changeHandler flow operation",event.operation,"text", ito ? ito.text : '');
+        
+        var operation:FlowOperation = event.operation;
+
+        // Close the dropDown if we press delete or cut the selected text
+        if (operation is DeleteTextOperation || operation is CutOperation)
+        {
+            closeDropDown(false);
+        }
+        else
+        {
+            if (openOnInput)
             {
-                textInput.textDisplay.selectAll();
+                if (!isDropDownOpen)
+                {
+                    // Open the dropDown if it isn't already open
+                    //trace("CB dropDown closed. processInputField delayed");
+                    openDropDown();
+                    addEventListener(DropDownEvent.OPEN, editingOpenHandler);
+                    return;
+                }   
+     
+                processInputField();
             }
         }
     }
     
     /**
-     *  @private
-     */
-    override protected function isOurFocus(target:DisplayObject):Boolean
-    {
-        return target == textInput.textDisplay;
-    }
-    
-    /**
-     *  @private 
-     */ 
-    override protected function dropDownController_closeHandler(event:DropDownEvent):void
-    {
-        super.dropDownController_closeHandler(event);
-        
-        if (!event.isDefaultPrevented())
-        {
-            if (actualProposedSelectedIndex == CUSTOM_SELECTED_ITEM)
-            {
-                var itemFromInput:* = getCustomSelectedItem();
-                if (itemFromInput != undefined)
-                    selectedItem = itemFromInput;
-                else
-                    selectedIndex = NO_SELECTION;
-            }
-            else
-            {
-                selectedIndex = actualProposedSelectedIndex;
-            }
-        }
-    }
-    
-    //--------------------------------------------------------------------------
-    //
-    //  Event Handlers
-    //
-    //--------------------------------------------------------------------------
-    
-    /**
-     *  @private 
-     */ 
-    private function textInput_focusInHandler(event:FocusEvent):void
-    {
-        isTextInputInFocus = true;
-    }
-    
-    /**
-     *  @private 
-     */ 
-    private function textInput_focusOutHandler(event:FocusEvent):void
-    {
-        isTextInputInFocus = false;
-    }
-    
-    /**
-     *  @private 
-     */ 
-    protected function textInput_changeHandler(event:Event):void
-    {   
-        // Ignore the ENTER key
-        /*if (isEnterKeyDown)
-            return;*/
-        //trace("CB.textInput_changeHandler");
-        /* TODO (jszeto) Figure out how to find the new text
-        
-        Two ways of doing the interaction:
-        
-        1. DropDown shows set of possible choices  
-        
-        - Behavior as defined in XD spec
-        - Create new function that takes an input string and returns the array of data items
-        that match string
-        - Figure out how to only display a subset of the dataProvider. Use collection filters?
-        
-        2. DropDown highlights first match
-        
-        - DropDown opens if we find a match
-        - Match is highlighted, but not selected until Enter or mouse click selects the item
-        - Can use arrows to change selection
-        - Behavior of Halo ComboBox
-        
-        */
-       
-        
-        // Open the dropDown if it isn't already open
-        if (openOnInput)
-        {
-            if (!isDropDownOpen)
-            {
-                openDropDown();
-                addEventListener(DropDownEvent.OPEN, editingOpenHandler);
-                return;
-            }   
-            
-            processInputField();
-        }
-    }
-    
-    /**
      *  @private 
      */ 
     private function editingOpenHandler(event:DropDownEvent):void
     {
+        //trace("CB calling delayed processInputField");
         removeEventListener(DropDownEvent.OPEN, editingOpenHandler);
         processInputField();
     }
     
     
-    
-    
         
 }
 }
            textInput.maxChars = maxChars;
            textInput.restrict = restrict;
            textInput.focusEnabled = false;
        }
    }
    

        if (!isTextInputInFocus)
        {
            //trace("ComboBox.keyDownHandler code",event.keyCode,"IGNORED");
            keyDownHandlerHelper(event);
        }
        
        // No op. ComboBox listens for keyboard events in the capture phase
