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 a3dc3644357..2dac3ec9ee4 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 @@ -567,7 +567,15 @@ public void markAsDirty() { * this node is not attached */ public boolean isAttached() { - return parent != null && parent.isAttached(); + if (getParent() == null) { + return false; + } else { + StateNode root = getParent(); + while (root.getParent() != null) { + root = root.getParent(); + } + return root.isAttached(); + } } /**