             if (lastFocusedElement && ensureElementIsVisibleForSoftKeyboard &&
                 (keyboardRect.height != oldSoftKeyboardHeight ||
                  keyboardRect.width != oldSoftKeyboardWidth))
-                ensureElementIsVisible(lastFocusedElement);
+            {
+                // lastFocusedElementCaretBounds might have been set in the 
+                // caretBoundsChange event handler
+                if (lastFocusedElementCaretBounds == null)
+                {
+                    ensureElementIsVisible(lastFocusedElement);
+                }
+                else
+                {
+                    ensureElementPositionIsVisible(lastFocusedElement, lastFocusedElementCaretBounds);   
+                    lastFocusedElementCaretBounds = null;
+                }
+            }
             
             oldSoftKeyboardHeight = keyboardRect.height;
             oldSoftKeyboardWidth = keyboardRect.width;
-            
         }
     }
     

     *  @private 
     */
    mx_internal var preventThrows:Boolean = false;

    //--------------------------------------------------------------------------
    //
    //  Properties

import spark.effects.easing.IEaser;
import spark.effects.easing.Power;
import spark.effects.easing.Sine;
import spark.events.CaretBoundsChangeEvent;
import spark.layouts.supportClasses.LayoutBase;
import spark.utils.MouseEventUtil;

