fix: text restore & deletion issues (#9853)

This commit is contained in:
Marcel Mraz
2025-08-12 09:27:04 +02:00
committed by GitHub
parent cc8e490c75
commit 54c148f390
14 changed files with 229 additions and 154 deletions

View File

@@ -704,7 +704,7 @@ describe("textWysiwyg", () => {
rectangle.x + rectangle.width / 2,
rectangle.y + rectangle.height / 2,
);
expect(h.elements.length).toBe(2);
expect(h.elements.length).toBe(3);
text = h.elements[1] as ExcalidrawTextElementWithContainer;
expect(text.type).toBe("text");
@@ -1198,7 +1198,11 @@ describe("textWysiwyg", () => {
updateTextEditor(editor, " ");
Keyboard.exitTextEditor(editor);
expect(rectangle.boundElements).toStrictEqual([]);
expect(h.elements[1]).toBeUndefined();
expect(h.elements[1]).toEqual(
expect.objectContaining({
isDeleted: true,
}),
);
});
it("should restore original container height and clear cache once text is unbind", async () => {