From 045d0c89affc6c3c1913f49bc1b19486aede1e69 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 8 Mar 2023 07:55:31 +0000 Subject: [PATCH] Improve UX around selecting rows and cells --- .../src/components/sheet/MenuOverlay.svelte | 6 ++++-- .../src/components/sheet/StickyColumn.svelte | 12 +++++++----- .../src/components/sheet/stores/interface.js | 14 ++++++++++++++ 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/packages/frontend-core/src/components/sheet/MenuOverlay.svelte b/packages/frontend-core/src/components/sheet/MenuOverlay.svelte index 24361cfd9c..1a96a0132e 100644 --- a/packages/frontend-core/src/components/sheet/MenuOverlay.svelte +++ b/packages/frontend-core/src/components/sheet/MenuOverlay.svelte @@ -9,7 +9,7 @@ } from "@budibase/bbui" import { getContext } from "svelte" - const { selectedCellRow, menu, rows, columns, selectedCellId } = + const { selectedCellRow, menu, rows, columns, selectedCellId, stickyColumn } = getContext("sheet") let modal @@ -33,7 +33,8 @@ delete clone.__idx const newRow = await rows.actions.addRow(clone, $selectedCellRow.__idx + 1) if (newRow) { - $selectedCellId = `${newRow._id}-${$columns[0].name}` + const column = $stickyColumn?.name || $columns[0].name + $selectedCellId = `${newRow._id}-${column}` menu.actions.close() } } @@ -62,6 +63,7 @@