                 
                 validateNow(); // Validate so that other listeners like Scroller get the updated dimensions
             }
+        }
+    }
+    
+    /**
+     *  @private
+     *  Called when a softKeyboard activation target is removed from the
+     *  stage.  If the target has stage focus, then the focus is set to null.
+     *  This will cause a SOFT_KEYBOARD_DEACTIVATE event to be dispatched.
+     */ 
+    private function softKeyboardTarget_removeFromStageHandler(event:Event):void
+    {
+        if (stage.focus == softKeyboardTarget)
+            stage.focus = null;
+        
+        // clearSoftKeyboardTarget() is called in response to the SOFT_KEYBOARD_DEACTIVATE
+        // event and will clear the removeFromStage listener and softKeyboardDeactivate 
+        // events from the target.
+    }
+    
+    /**
+     *  @private
+     *  This method clears the cached softKeyboard target and removes the
+     *  removeFromStage handler that is added in the softKeyboardActivateHandler
+     *  method.
+     */
+    private function clearSoftKeyboardTarget():void
+    {
+        if (softKeyboardTarget)
+        {
+            if (isIOS)
+            {
+                softKeyboardTarget.removeEventListener(SoftKeyboardEvent.SOFT_KEYBOARD_DEACTIVATE, 
+                                                       softKeyboardDeactivateHandler);
+            }
+            
+            softKeyboardTarget.removeEventListener(Event.REMOVED_FROM_STAGE, softKeyboardTarget_removeFromStageHandler);
+            softKeyboardTarget = null;
         }
     }
     

    {        
        if (this === FlexGlobals.topLevelApplication)
        {
            // Get the keyboard size
            var keyboardRect:Rectangle = stage.softKeyboardRect;
     

     */ 
    private function softKeyboardDeactivateHandler(event:SoftKeyboardEvent):void
    {
        if (this === FlexGlobals.topLevelApplication && isSoftKeyboardActive)
        {            
            if (softKeyboardTarget)
                clearSoftKeyboardTarget();
            
            isSoftKeyboardActive = false;
            
            if (softKeyboardBehavior == "none" && resizeForSoftKeyboard)
