1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00

Merge pull request #19109 from calixteman/click_when_dragging

[Editor] Disallow to have multiple pointers while dragging an editor
This commit is contained in:
calixteman 2024-11-27 20:26:45 +01:00 committed by GitHub
commit 22babd722f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 99 additions and 37 deletions

View file

@ -1492,4 +1492,42 @@ describe("Stamp Editor", () => {
);
});
});
describe("Drag a stamp annotation and click on a touchscreen", () => {
let pages;
beforeAll(async () => {
pages = await loadAndWait("empty.pdf", ".annotationEditorLayer");
});
afterAll(async () => {
await closePages(pages);
});
it("must check that the annotation isn't unselected when an other finger taps on the screen", async () => {
// Run sequentially to avoid clipboard issues.
for (const [browserName, page] of pages) {
if (browserName === "chrome") {
// TODO: remove this check when puppeteer supports multiple touch
// events (it works in v23.9.1).
return;
}
await switchToStamp(page);
await copyImage(page, "../images/firefox_logo.png", 0);
const editorSelector = getEditorSelector(0);
const stampRect = await getRect(page, editorSelector);
await page.touchscreen.tap(stampRect.x + 10, stampRect.y + 10);
await waitForSelectedEditor(page, editorSelector);
await page.touchscreen.touchStart(stampRect.x + 10, stampRect.y + 10);
await page.touchscreen.touchMove(stampRect.x + 20, stampRect.y + 20);
await page.touchscreen.tap(stampRect.x - 10, stampRect.y - 10);
await page.touchscreen.touchEnd();
await waitForSelectedEditor(page, editorSelector);
}
});
});
});