diff --git a/src/basesprite.js b/src/basesprite.js
index <HASH>..<HASH> 100644
--- a/src/basesprite.js
+++ b/src/basesprite.js
@@ -318,7 +318,7 @@ export default class BaseSprite extends BaseNode {
         this[_animations].delete(animation)
       })
     })
-    if(parent && parent.clearLayout) parent.clearLayout()
+    if(this.hasLayout) parent.clearLayout()
     return ret
   }
 
@@ -327,9 +327,9 @@ export default class BaseSprite extends BaseNode {
     if(this.cache) {
       this.cache = null
     }
+    if(this.hasLayout) parent.clearLayout()
     const ret = super.disconnect(parent)
     delete this.context
-    if(parent && parent.clearLayout) parent.clearLayout()
     return ret
   }
 
diff --git a/src/group.js b/src/group.js
index <HASH>..<HASH> 100644
--- a/src/group.js
+++ b/src/group.js
@@ -519,6 +519,11 @@ export default class Group extends BaseSprite {
   }
   clearLayout() {
     this[_layoutTag] = false
+    let parent = this.parent
+    while(parent) {
+      if(parent[_layoutTag]) parent[_layoutTag] = false
+      parent = parent.parent
+    }
   }
   render(t, drawingContext) {
     if(this.attr('display') === 'flex' && !this[_layoutTag]) {
:bug: fixed layout nested