🐛 Fix preserving empty text fill when editing without changes (#10483)

This commit is contained in:
Alejandro Alonso 2026-06-30 17:59:54 +02:00 committed by GitHub
parent 920c6d4e76
commit 05e9c68a74
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 31 additions and 2 deletions

View File

@ -331,3 +331,33 @@ test("BUG 14098 - Fix text editor having 0 width or height", async ({ page }) =>
const textEditor = workspace.page.locator(`div[class*="viewport"]`).first().getByRole('textbox').first();
await expect(textEditor).toBeVisible();
});
test("Preserves empty fill after editing text without changes", async ({ page }) => {
const initialText = "Hello";
const workspace = new WasmWorkspacePage(page, {
textEditor: true,
});
await workspace.setupEmptyFile();
await workspace.mockRPC("update-file?id=*", "text-editor/update-file.json");
await workspace.goToWorkspace();
await workspace.createTextShape(190, 150, 300, 200, initialText);
await workspace.textEditor.stopEditing();
const fillColorButton = workspace.page.getByRole("button", {
name: "#000000",
});
await expect(fillColorButton).toBeVisible();
await workspace.page.getByRole("button", { name: "Remove color" }).click();
await expect(fillColorButton).toHaveCount(0);
await workspace.doubleClickLeafLayer(initialText);
await workspace.textEditor.waitForEditor();
await workspace.moveButton.click();
await workspace.clickAt(100, 100);
await workspace.clickLeafLayer(initialText);
await expect(fillColorButton).toHaveCount(0);
await expect(workspace.page.getByTestId("add-fill")).toBeVisible();
});

View File

@ -42,8 +42,7 @@
(let [attrs (or attrs [])
value-empty? (fn [v]
(or (nil? v)
(and (string? v) (empty? v))
(and (coll? v) (empty? v))))]
(and (string? v) (empty? v))))]
(reduce (fn [acc key]
(let [style (.-style element)
value (if (contains? styles/mapping key)