Skip to content

Commit

Permalink
raw parent is properly set when updated (#985)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxence-charriere authored Aug 22, 2024
1 parent 16d1aea commit 4c248da
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/app/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down
1 change: 1 addition & 0 deletions pkg/app/node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -841,6 +841,7 @@ func TestNodeManagerUpdate(t *testing.T) {
require.IsType(t, Raw(""), newSpan)
require.Equal(t, "<span>bye</span>", newSpan.(*raw).value)
require.True(t, newSpan.Mounted())
require.Equal(t, body, newSpan.parent())
require.False(t, span.Mounted())
})

Expand Down

0 comments on commit 4c248da

Please sign in to comment.