fix: disable app context menu
This commit is contained in:
2 files changed
+8
-1
No files matched your search
@@ -37,7 +37,7 @@ export const WidgetContextMenu = ({ item, definition, widgetStateRef, children }
|
|||||||
const [isEditMode] = useEditMode();
|
const [isEditMode] = useEditMode();
|
||||||
const settings = useSettings();
|
const settings = useSettings();
|
||||||
|
|
||||||
if (!session || !settings.enableRightClickOnWidgets || isEditMode) return <>{children}</>;
|
if (!session || !settings.enableRightClickOnWidgets || isEditMode || item.kind === "app") return <>{children}</>;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<WidgetContextMenuInner item={item} definition={definition} widgetStateRef={widgetStateRef} settings={settings}>
|
<WidgetContextMenuInner item={item} definition={definition} widgetStateRef={widgetStateRef} settings={settings}>
|
||||||
|
|||||||
@@ -151,6 +151,13 @@ describe("Board grid", () => {
|
|||||||
await nestedAppLink.click();
|
await nestedAppLink.click();
|
||||||
await expect(page).toHaveURL(/#board-app-opened$/);
|
await expect(page).toHaveURL(/#board-app-opened$/);
|
||||||
await page.evaluate(() => history.replaceState(null, "", `${location.pathname}${location.search}`));
|
await page.evaluate(() => history.replaceState(null, "", `${location.pathname}${location.search}`));
|
||||||
|
|
||||||
|
await firstItem.click({ button: "right" });
|
||||||
|
await expect(page.getByRole("menu")).toBeVisible();
|
||||||
|
await page.keyboard.press("Escape");
|
||||||
|
await nestedItem.click({ button: "right" });
|
||||||
|
await expect(page.getByRole("menu")).toHaveCount(0);
|
||||||
|
|
||||||
const normalZoomTileBox = await expectBoundingBoxAsync(logicalTile);
|
const normalZoomTileBox = await expectBoundingBoxAsync(logicalTile);
|
||||||
const secondItemBox = await expectBoundingBoxAsync(secondItem);
|
const secondItemBox = await expectBoundingBoxAsync(secondItem);
|
||||||
expect(secondItemBox.x - (normalZoomTileBox.x + normalZoomTileBox.width)).toBeCloseTo(
|
expect(secondItemBox.x - (normalZoomTileBox.x + normalZoomTileBox.width)).toBeCloseTo(
|
||||||
|
|||||||
Reference in new issue
Block a user