feat: expose applyTo options, don't commit empty text element (#9744)

* Expose applyTo options, skip re-draw for empty text

* Don't commit empty text elements
This commit is contained in:
Marcel Mraz
2025-07-17 15:22:32 +02:00
committed by GitHub
parent 678dff25ed
commit e46f038132
3 changed files with 27 additions and 8 deletions

View File

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