You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ca...@apache.org on 2020/04/22 16:54:08 UTC

[royale-asjs] branch develop updated: StyledUIBase: add SetFocus and tabIndex. remove SetFocus from TextInputBase.

This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
     new dd9f456  StyledUIBase: add SetFocus and tabIndex. remove SetFocus from TextInputBase.
dd9f456 is described below

commit dd9f456b710bdeb3913ca9fbff389bae47650b0f
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Wed Apr 22 18:54:03 2020 +0200

    StyledUIBase: add SetFocus and tabIndex. remove SetFocus from TextInputBase.
---
 .../royale/org/apache/royale/core/StyledUIBase.as  | 36 ++++++++++++++++++++++
 .../supportClasses/textinput/TextInputBase.as      | 18 +----------
 2 files changed, 37 insertions(+), 17 deletions(-)

diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/StyledUIBase.as b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/StyledUIBase.as
index 24cf32b..5a717da 100644
--- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/StyledUIBase.as
+++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/StyledUIBase.as
@@ -497,5 +497,41 @@ package org.apache.royale.core
                 }
             }   
         }
+
+
+        /**
+		 *  perform the set focus on the element
+		 *
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.9.7
+         */
+        public function setFocus(preventScroll:Boolean = false):void
+		{
+			COMPILE::JS
+			{
+			element.focus({preventScroll: preventScroll});
+			}
+		}
+        
+        /**
+		 *  the tabIndex of the element
+		 *
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.9.7
+         */
+        COMPILE::JS
+		public function get tabIndex():int
+		{
+			return element.tabIndex;
+		}
+        COMPILE::JS
+		public function set tabIndex(value:int):void
+		{
+			element.tabIndex = value;
+		}
     }
 }
\ No newline at end of file
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/textinput/TextInputBase.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/textinput/TextInputBase.as
index ad60765..9bd24b7 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/textinput/TextInputBase.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/textinput/TextInputBase.as
@@ -45,7 +45,7 @@ package org.apache.royale.jewel.supportClasses.textinput
     /**
      *  Dispatched when the user presses the Enter key.
      *
-     *  @eventType mx.events.FlexEvent.ENTER
+     *  @eventType org.apache.royale.events.KeyboardEvent.KEYCODE__ENTER
      *
      *  @langversion 3.0
      *  @playerversion Flash 10.2
@@ -247,21 +247,5 @@ package org.apache.royale.jewel.supportClasses.textinput
             _positioner.royale_wrapper = this;
 			_positioner.appendChild(input);
 		}
-
-        /**
-         *  set focus on the text box programatically
-         * 
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion Royale 0.9.7
-         */
-		public function setFocus():void
-		{
-            COMPILE::JS
-            {
-                input.focus();
-            }
-        }
 	}
 }