@lvce-editor/renderer-process 23.1.0 → 23.2.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.
@@ -1091,12 +1091,20 @@ const applyPatch = ($Element, patches, eventMap = {}, id = 0) => {
1091
1091
  break;
1092
1092
  case NavigateChild:
1093
1093
  {
1094
- const $Child = $Current.childNodes[patch.index];
1094
+ const $Children = $Current.childNodes;
1095
+ const $Child = $Children[patch.index];
1095
1096
  if (!$Child) {
1097
+ const nextPatch = patches[patchIndex + 1];
1098
+ if (nextPatch && nextPatch.type === Replace && patch.index === $Children.length) {
1099
+ const $Placeholder = document.createComment('virtual-dom-placeholder');
1100
+ $Current.append($Placeholder);
1101
+ $Current = $Placeholder;
1102
+ break;
1103
+ }
1096
1104
  console.error('Cannot navigate to child: child not found at index', {
1097
1105
  $Current,
1098
1106
  index: patch.index,
1099
- childCount: $Current.childNodes.length
1107
+ childCount: $Children.length
1100
1108
  });
1101
1109
  return;
1102
1110
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/renderer-process",
3
- "version": "23.1.0",
3
+ "version": "23.2.0",
4
4
  "keywords": [
5
5
  "lvce-editor",
6
6
  "renderer-process"