Skip to content

Commit

Permalink
fix, ssc createNode operatin bug, when target node (by path) is a tex…
Browse files Browse the repository at this point in the history
…t node
  • Loading branch information
leobm committed Nov 22, 2022
1 parent fcfe7a4 commit dce536e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/IHP/static/vendor/ihp-ssc.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,12 @@ function evaluateNodeOperation(component, nodeOperation) {

function createNode(component, nodeOperation) {
var newElement = htmlStringToDomNode(nodeOperation.html);
nodeOperation.domNode.appendChild(newElement);
var domNode = nodeOperation.domNode;
if (domNode.nodeType == Node.TEXT_NODE) {
domNode.replaceWith(newElement);
} else {
domNode.appendChild(newElement);
}
}

function updateTextContent(component, nodeOperation) {
Expand Down

0 comments on commit dce536e

Please sign in to comment.