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 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 {

View File

@ -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)