fix: restoreElementWithProperties drops "parent" property (#5742)

Co-authored-by: Yosyp Buchma <yo@yosyp.co>
Co-authored-by: dwelle <luzar.david@gmail.com>
This commit is contained in:
Joseph Buchma
2022-10-08 20:42:05 +02:00
committed by GitHub
co-authored by Yosyp Buchma dwelle
parent 76cf560914
commit e9a224a0de
5 changed files with 41 additions and 19 deletions
+2 -1
View File
@@ -18,6 +18,7 @@ import throttle from "lodash.throttle";
import { newElementWith } from "../../element/mutateElement";
import { BroadcastedExcalidrawElement } from "./reconciliation";
import { encryptData } from "../../data/encryption";
import { PRECEDING_ELEMENT_KEY } from "../../constants";
class Portal {
collab: TCollabClass;
@@ -152,7 +153,7 @@ class Portal {
acc.push({
...element,
// z-index info for the reconciler
parent: idx === 0 ? "^" : elements[idx - 1]?.id,
[PRECEDING_ELEMENT_KEY]: idx === 0 ? "^" : elements[idx - 1]?.id,
});
}
return acc;