You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ah...@apache.org on 2020/04/28 04:52:55 UTC

[royale-asjs] 01/02: ignore non-UIBase widgets used in virtual lists. Should fix #811

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

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

commit 6b23544521c3b450231a5395d03543713151c64f
Author: Alex Harui <ah...@apache.org>
AuthorDate: Mon Apr 27 21:47:06 2020 -0700

    ignore non-UIBase widgets used in virtual lists.  Should fix #811
---
 .../src/main/royale/mx/core/UIComponent.as         | 31 ++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as b/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as
index 079ec9c..a44b20d 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as
@@ -77,6 +77,7 @@ import org.apache.royale.core.IUIBase;
 import org.apache.royale.core.TextLineMetrics;
 import org.apache.royale.core.UIBase;
 import org.apache.royale.core.ValuesManager;
+import org.apache.royale.core.WrappedHTMLElement;
 import org.apache.royale.core.IBorderPaddingMarginValuesImpl;
 import org.apache.royale.core.styles.BorderStyles;
 import org.apache.royale.effects.IEffect;
@@ -3508,6 +3509,36 @@ COMPILE::JS
     {
         return numElements;
     }
+
+    /**
+     *  @copy org.apache.royale.core.IParent#numElements
+     * 
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion Royale 0.0
+     *  @royaleignorecoercion org.apache.royale.core.WrappedHTMLElement
+     */
+    override public function get numElements():int
+    {
+        COMPILE::SWF
+        {
+            return super.numElements;
+        }
+        COMPILE::JS
+        {
+            var arr:Array = internalChildren();
+			var n:int = arr.length;
+			var num:int = 0;
+			for (var i:int = 0; i < n; i++)
+			{
+				if ((arr[i] as WrappedHTMLElement).royale_wrapper)
+					num++;
+			}
+			return num;
+        }
+    }
+
     
     /**
      *  @private