🛂(frontend) block drag n drop when not desktop

Scrolling on mobile devices was causing issues
with drag and drop functionality, documents were
being moved unintentionally.
This commit disables drag and drop on mobile devices
to prevent this issue.
This commit is contained in:
Anthony LC
2025-07-30 12:14:32 +02:00
parent 7f450e8aa8
commit 2cbe363a5f
8 changed files with 97 additions and 9 deletions

View File

@@ -10,7 +10,15 @@ export const createRootSubPage = async (
page: Page,
browserName: string,
docName: string,
isMobile: boolean = false,
) => {
if (isMobile) {
await page
.getByRole('button', { name: 'Open the header menu' })
.getByText('menu')
.click();
}
// Get response
const responsePromise = waitForResponseCreateDoc(page);
await clickOnAddRootSubPage(page);
@@ -18,6 +26,13 @@ export const createRootSubPage = async (
expect(response.ok()).toBeTruthy();
const subPageJson = (await response.json()) as { id: string };
if (isMobile) {
await page
.getByRole('button', { name: 'Open the header menu' })
.getByText('menu')
.click();
}
// Get doc tree
const docTree = page.getByTestId('doc-tree');
await expect(docTree).toBeVisible();
@@ -29,6 +44,13 @@ export const createRootSubPage = async (
await expect(subPageItem).toBeVisible();
await subPageItem.click();
if (isMobile) {
await page
.getByRole('button', { name: 'Open the header menu' })
.getByText('close')
.click();
}
// Update sub page name
const randomDocs = randomName(docName, browserName, 1);
await updateDocTitle(page, randomDocs[0]);