flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mamsel...@apache.org
Subject [1/3] git commit: [flex-sdk] [refs/heads/develop] - UPDATE FLEX-33166 Mobile TextInput with native StageTextInput cannot be included in scrollable forms - prevent touch scrolling from being initiated in a TextInput
Date Fri, 22 Nov 2013 10:30:09 GMT
Updated Branches:
  refs/heads/develop c1b8214bc -> 1bb2964be


UPDATE  FLEX-33166 Mobile TextInput with native StageTextInput cannot be included in scrollable
forms
- prevent touch scrolling from being initiated in a TextInput


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/dba8dd37
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/dba8dd37
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/dba8dd37

Branch: refs/heads/develop
Commit: dba8dd37b83976309f8b62e23c2d563e5f86018c
Parents: dc4ebc0
Author: mamsellem <maurice.amsellem@systar.com>
Authored: Fri Nov 22 09:52:55 2013 +0100
Committer: mamsellem <maurice.amsellem@systar.com>
Committed: Fri Nov 22 09:52:55 2013 +0100

----------------------------------------------------------------------
 .../supportClasses/SkinnableTextBase.as         | 37 ++++++++------------
 1 file changed, 14 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/dba8dd37/frameworks/projects/spark/src/spark/components/supportClasses/SkinnableTextBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spark/src/spark/components/supportClasses/SkinnableTextBase.as
b/frameworks/projects/spark/src/spark/components/supportClasses/SkinnableTextBase.as
index 7f4a29d..d43ca69 100644
--- a/frameworks/projects/spark/src/spark/components/supportClasses/SkinnableTextBase.as
+++ b/frameworks/projects/spark/src/spark/components/supportClasses/SkinnableTextBase.as
@@ -516,7 +516,7 @@ public class SkinnableTextBase extends SkinnableComponent
      *  The IEditableText that may be present
      *  in any skin assigned to this component.
      *  This is RichEditableText for the Spark theme
-     *  and StyleableStageText for the Mobile theme.
+     *  and StyleableStageText/ScrollableStageText for the Mobile theme.
      *  
      *  @langversion 3.0
      *  @playerversion Flash 10
@@ -1719,15 +1719,15 @@ public class SkinnableTextBase extends SkinnableComponent
             if (getStyle("interactionMode") == InteractionMode.TOUCH && !touchHandlersAdded)
             {
                 addEventListener(MouseEvent.MOUSE_DOWN, touchMouseDownHandler);
-                addEventListener(TouchInteractionEvent.TOUCH_INTERACTION_START,
-                    touchInteractionStartHandler);
+                addEventListener(TouchInteractionEvent.TOUCH_INTERACTION_STARTING,
+                        touchInteractionStartingHandler);
                 touchHandlersAdded = true;
             }
             else if (getStyle("interactionMode") == InteractionMode.MOUSE && touchHandlersAdded)
             {
                 removeEventListener(MouseEvent.MOUSE_DOWN, touchMouseDownHandler);
-                removeEventListener(TouchInteractionEvent.TOUCH_INTERACTION_START,
-                    touchInteractionStartHandler);
+                removeEventListener(TouchInteractionEvent.TOUCH_INTERACTION_STARTING,
+                        touchInteractionStartingHandler);
                 touchHandlersAdded = false;
             }
         }
@@ -2606,23 +2606,23 @@ public class SkinnableTextBase extends SkinnableComponent
      */ 
     private function touchMouseUpHandler(event:Event):void
     {        
-        /* 
-         We set the focus on the component on mouseUp to activate the softKeyboard   
+        /*
+         We set the focus on the component on mouseUp to activate the softKeyboard
          We only set focus if the following conditions are met:
          1. mouseUp occurs on this component
          2. mouseDown occured on any subcomponent besides the textDisplay OR
          mouseDown occurred on textDisplay and mouseUp did not occur on textDisplay
-        
+
          The mouseDown and mouseUp on textDisplay case is handled by the Player
-        */        
-        if ((event.target is DisplayObject && contains(DisplayObject(event.target)))

+        */
+        if ((event.target is DisplayObject && contains(DisplayObject(event.target)))
             && (delaySetFocus ||
              (mouseDownTarget == textDisplay && event.target != textDisplay)))
         {
             if (textDisplay)
                 textDisplay.setFocus();
         }
-        
+
         clearMouseDownState();
     }
        
@@ -2630,19 +2630,10 @@ public class SkinnableTextBase extends SkinnableComponent
      * @private
      * Called if we are inside of a Scroller and the user has started a scroll gesture
      */
-    private function touchInteractionStartHandler(event:TouchInteractionEvent):void
+    private function touchInteractionStartingHandler(event:TouchInteractionEvent):void
     {
-        // if in iOS and keyboard is up and scrolling is occurring, drop the keyboard
-        var topLevelApp:Application = FlexGlobals.topLevelApplication as Application;
-        if (isIOS && topLevelApp && topLevelApp.isSoftKeyboardActive &&
editable)
-        {
-            // set focus
-            stage.focus = null;
-        }
-        
-        // Clear out the state because starting a scroll gesture should never 
-        // open the soft keyboard
-        clearMouseDownState();
+        //   don't allow initiating scrolling from a TextInput on mobile anymore
+          event.preventDefault();
     }    
     
     /**


Mime
View raw message