Fix selecting newly created rows

This commit is contained in:
Andrew Kingston 2023-03-31 13:16:40 +01:00
parent ff4c0aed46
commit 5d554d0616
2 changed files with 2 additions and 5 deletions

View File

@ -38,7 +38,7 @@
const addRow = async () => { const addRow = async () => {
const savedRow = await rows.actions.addRow(newRow) const savedRow = await rows.actions.addRow(newRow)
if (savedRow && firstColumn) { if (savedRow && firstColumn) {
$selectedCellId = `${newRow._id}-${firstColumn.name}` $selectedCellId = `${savedRow._id}-${firstColumn.name}`
isAdding = false isAdding = false
} }
} }
@ -201,15 +201,12 @@
left: 0; left: 0;
width: 100%; width: 100%;
transition: margin-bottom 130ms ease-out; transition: margin-bottom 130ms ease-out;
margin-top: -1px;
} }
.new-row.visible { .new-row.visible {
margin-bottom: 0; margin-bottom: 0;
} }
.new-row :global(.cell) { .new-row :global(.cell) {
/*border-bottom: 0;*/
--cell-background: var(--background) !important; --cell-background: var(--background) !important;
border-top: var(--cell-border);
} }
.sticky-column { .sticky-column {

View File

@ -127,7 +127,7 @@ export const createRowsStore = context => {
const newRow = await API.saveRow({ ...row, tableId: get(tableId) }) const newRow = await API.saveRow({ ...row, tableId: get(tableId) })
// Update state // Update state
if (idx) { if (idx != null) {
rowCacheMap[newRow._id] = true rowCacheMap[newRow._id] = true
rows.update(state => { rows.update(state => {
state.splice(idx, 0, newRow) state.splice(idx, 0, newRow)