From 5a0ae3ff01f1dc72c03d12e31c1ab0379dca884d Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 11 May 2023 11:58:26 +0100 Subject: [PATCH] Disable most context menu options for cells in the new row --- .../src/components/grid/overlays/MenuOverlay.svelte | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/frontend-core/src/components/grid/overlays/MenuOverlay.svelte b/packages/frontend-core/src/components/grid/overlays/MenuOverlay.svelte index d0379edee6..15ca08dbdf 100644 --- a/packages/frontend-core/src/components/grid/overlays/MenuOverlay.svelte +++ b/packages/frontend-core/src/components/grid/overlays/MenuOverlay.svelte @@ -7,6 +7,7 @@ notifications, } from "@budibase/bbui" import { getContext } from "svelte" + import { NewRowID } from "../lib/constants" const { focusedRow, @@ -20,9 +21,11 @@ clipboard, dispatch, focusedCellAPI, + focusedRowId, } = getContext("grid") $: style = makeStyle($menu) + $: isNewRow = $focusedRowId === NewRowID const makeStyle = menu => { return `left:${menu.left}px; top:${menu.top}px;` @@ -69,7 +72,7 @@ dispatch("edit-row", $focusedRow)} on:click={menu.actions.close} > @@ -77,7 +80,7 @@ copyToClipboard($focusedRow?._id)} on:click={menu.actions.close} > @@ -85,7 +88,7 @@ copyToClipboard($focusedRow?._rev)} on:click={menu.actions.close} > @@ -93,14 +96,14 @@ Duplicate row Delete row