You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by ac...@apache.org on 2018/04/20 08:43:10 UTC

incubator-weex git commit: * [iOS] try to fix the recycleList component introduced by #1105

Repository: incubator-weex
Updated Branches:
  refs/heads/master d36a34c85 -> 7a8732b3e


* [iOS] try to fix the recycleList component introduced by #1105


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/7a8732b3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/7a8732b3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/7a8732b3

Branch: refs/heads/master
Commit: 7a8732b3ef653a8e62da82e9787adee157ff9e53
Parents: d36a34c
Author: acton393 <zh...@gmail.com>
Authored: Fri Apr 20 16:42:51 2018 +0800
Committer: acton393 <zh...@gmail.com>
Committed: Fri Apr 20 16:42:51 2018 +0800

----------------------------------------------------------------------
 .../WeexSDK/Sources/Layout/WXComponent+Layout.m    | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/7a8732b3/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.m b/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.m
index db40bc0..aac8566 100644
--- a/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.m
+++ b/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.m
@@ -36,13 +36,20 @@
 - (void)setNeedsLayout
 {
     WXComponent *supercomponent = [self supercomponent];
-    if(supercomponent){
-        for (WXComponent *siblingComponent in [supercomponent subcomponents]) {
-            [siblingComponent _needRecalculateLayout];
-        }
+    if (self->_virtualComponentId || self->_templateComponent) {
+        // we will generate a virtualComponentId for recycleList virtual component or templateComponent for recycleList component template.
+        // as for recyclelist component, it depends on the input data, not the new layout, here will not try to clear slibling child layout.
+        _isLayoutDirty = YES;
         [supercomponent setNeedsLayout];
     } else {
-        [self _needRecalculateLayout];
+        if(supercomponent){
+            for (WXComponent *siblingComponent in [supercomponent subcomponents]) {
+                [siblingComponent _needRecalculateLayout];
+            }
+            [supercomponent setNeedsLayout];
+        } else {
+            [self _needRecalculateLayout];
+        }
     }
 }