From 5d554d0616916659c02e0746ee749fa737356b1d Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 31 Mar 2023 13:16:40 +0100 Subject: [PATCH] Fix selecting newly created rows --- .../frontend-core/src/components/sheet/layout/NewRow.svelte | 5 +---- packages/frontend-core/src/components/sheet/stores/rows.js | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/frontend-core/src/components/sheet/layout/NewRow.svelte b/packages/frontend-core/src/components/sheet/layout/NewRow.svelte index 9aba724ad5..e71fa57876 100644 --- a/packages/frontend-core/src/components/sheet/layout/NewRow.svelte +++ b/packages/frontend-core/src/components/sheet/layout/NewRow.svelte @@ -38,7 +38,7 @@ const addRow = async () => { const savedRow = await rows.actions.addRow(newRow) if (savedRow && firstColumn) { - $selectedCellId = `${newRow._id}-${firstColumn.name}` + $selectedCellId = `${savedRow._id}-${firstColumn.name}` isAdding = false } } @@ -201,15 +201,12 @@ left: 0; width: 100%; transition: margin-bottom 130ms ease-out; - margin-top: -1px; } .new-row.visible { margin-bottom: 0; } .new-row :global(.cell) { - /*border-bottom: 0;*/ --cell-background: var(--background) !important; - border-top: var(--cell-border); } .sticky-column { diff --git a/packages/frontend-core/src/components/sheet/stores/rows.js b/packages/frontend-core/src/components/sheet/stores/rows.js index a62259eccc..6c44d24129 100644 --- a/packages/frontend-core/src/components/sheet/stores/rows.js +++ b/packages/frontend-core/src/components/sheet/stores/rows.js @@ -127,7 +127,7 @@ export const createRowsStore = context => { const newRow = await API.saveRow({ ...row, tableId: get(tableId) }) // Update state - if (idx) { + if (idx != null) { rowCacheMap[newRow._id] = true rows.update(state => { state.splice(idx, 0, newRow)