🐛 Fix problem when pasting text (#5671)

This commit is contained in:
Alonso Torres 2025-01-24 11:26:06 +01:00 committed by GitHub
parent 2ef22ecd08
commit 7458a35f31
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 16 additions and 3 deletions

View file

@ -7,7 +7,7 @@
- Fix errors from editable select on measures menu [Taiga #9888](https://tree.taiga.io/project/penpot/issue/9888)
- Fix exception on importing some templates from templates slider
- Consolidate adding share button to workspace
- Fix problem when pasting text [Taiga #9929](https://tree.taiga.io/project/penpot/issue/9929)
## 2.4.2

View file

@ -225,3 +225,16 @@ test("Bug 9066 - Problem with grid layout", async ({ page }) => {
page.getByTestId("children-6ad3e6b9-c5a0-80cf-8005-283bbe378bcb"),
).toHaveText(["CBCDEF"]);
});
test("[Taiga #9929] Paste text in workspace", async ({ page, context }) => {
const workspacePage = new WorkspacePage(page);
await workspacePage.setupEmptyFile(page);
await workspacePage.goToWorkspace();
await context.grantPermissions(["clipboard-read", "clipboard-write"]);
await page.evaluate(() => navigator.clipboard.writeText("Lorem ipsum dolor"));
await workspacePage.viewport.click({ button: "right" });
await page.getByText("PasteCtrlV").click();
await workspacePage.viewport
.getByRole("textbox")
.getByText("Lorem ipsum dolor");
});

View file

@ -1722,10 +1722,10 @@
(coll? transit-data)
(rx/of (paste-transit (assoc transit-data :in-viewport in-viewport?)))
(string? html-data)
(and (string? html-data) (d/not-empty? html-data))
(rx/of (paste-html-text html-data text-data))
(string? text-data)
(and (string? text-data) (d/not-empty? text-data))
(rx/of (paste-text text-data))
:else