From 4c248da90570cf448200947cc16c13b4759f4b6b Mon Sep 17 00:00:00 2001 From: Maxence Charriere Date: Thu, 22 Aug 2024 14:33:46 +0100 Subject: [PATCH] raw parent is properly set when updated (#985) --- pkg/app/node.go | 1 + pkg/app/node_test.go | 1 + 2 files changed, 2 insertions(+) diff --git a/pkg/app/node.go b/pkg/app/node.go index e17e2e49..03591ef4 100644 --- a/pkg/app/node.go +++ b/pkg/app/node.go @@ -605,6 +605,7 @@ func (m nodeManager) updateRawHTML(ctx Context, v, new *raw) (UI, error) { for parent := v.parent(); parent != nil; parent = parent.parent() { if parent, isHTML := parent.(HTML); isHTML { parent.JSValue().replaceChild(newMount, v) + newMount.setParent(parent) break } } diff --git a/pkg/app/node_test.go b/pkg/app/node_test.go index 788906b1..bba164ac 100644 --- a/pkg/app/node_test.go +++ b/pkg/app/node_test.go @@ -841,6 +841,7 @@ func TestNodeManagerUpdate(t *testing.T) { require.IsType(t, Raw(""), newSpan) require.Equal(t, "bye", newSpan.(*raw).value) require.True(t, newSpan.Mounted()) + require.Equal(t, body, newSpan.parent()) require.False(t, span.Mounted()) })