Skip to content

Commit

Permalink
Merge pull request #1565 from leobm/fix-ssc-createnode-op-bug
Browse files Browse the repository at this point in the history
fix, ssc createNode operation bug, when target node (by path) is a tex…
  • Loading branch information
mpscholten authored Nov 23, 2022
2 parents fcfe7a4 + dce536e commit d33879c
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 d33879c

Please sign in to comment.