diff --git a/flow-server/src/main/java/com/vaadin/flow/internal/StateNode.java b/flow-server/src/main/java/com/vaadin/flow/internal/StateNode.java index 9a4e75d60d3..ad911cf5967 100644 --- a/flow-server/src/main/java/com/vaadin/flow/internal/StateNode.java +++ b/flow-server/src/main/java/com/vaadin/flow/internal/StateNode.java @@ -574,7 +574,15 @@ public void markAsDirty() { * this node is not attached */ public boolean isAttached() { - return parent != null && parent.isAttached(); + if (getParent() == null) { + return false; + } else { + StateNode current = getParent(); + while (current.getParent() != null) { + current = current.getParent(); + } + return current.isAttached(); + } } /**