@lvce-editor/renderer-process 21.5.0 → 21.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/rendererProcessMain.js +9 -12
- package/package.json +1 -1
|
@@ -707,18 +707,15 @@ const replace = ($Element, nodes, eventMap = {}) => {
|
|
|
707
707
|
// Create a temporary container to render the new nodes
|
|
708
708
|
const $Temp = document.createElement('div');
|
|
709
709
|
renderInternal($Temp, nodes, eventMap, eventMap);
|
|
710
|
-
// Replace the current element with the new
|
|
711
|
-
|
|
712
|
-
if (!$
|
|
713
|
-
//
|
|
714
|
-
|
|
715
|
-
$
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
}
|
|
720
|
-
$Element.replaceWith($NewElement);
|
|
721
|
-
return $NewElement;
|
|
710
|
+
// Replace the current element with the new node(s)
|
|
711
|
+
const $NewNode = $Temp.firstChild;
|
|
712
|
+
if (!$NewNode) {
|
|
713
|
+
// No node was created, just remove the old element
|
|
714
|
+
$Element.remove();
|
|
715
|
+
return $Element;
|
|
716
|
+
}
|
|
717
|
+
$Element.replaceWith($NewNode);
|
|
718
|
+
return $NewNode;
|
|
722
719
|
};
|
|
723
720
|
const SetText = 1;
|
|
724
721
|
const Replace = 2;
|