Prevent deleting autocolumns via keyboard
This commit is contained in:
parent
43edf37f74
commit
d25128d45a
|
@ -112,6 +112,9 @@
|
||||||
if (!$selectedCellId) {
|
if (!$selectedCellId) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if ($selectedCellAPI?.isReadonly()) {
|
||||||
|
return
|
||||||
|
}
|
||||||
const [rowId, column] = $selectedCellId.split("-")
|
const [rowId, column] = $selectedCellId.split("-")
|
||||||
rows.actions.updateRow(rowId, column, null)
|
rows.actions.updateRow(rowId, column, null)
|
||||||
}, 100)
|
}, 100)
|
||||||
|
|
|
@ -20,7 +20,10 @@
|
||||||
|
|
||||||
$: {
|
$: {
|
||||||
if (selected) {
|
if (selected) {
|
||||||
selectedCellAPI.set(api)
|
selectedCellAPI.set({
|
||||||
|
...api,
|
||||||
|
isReadonly: () => !!column.schema.autocolumn,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -46,4 +49,4 @@
|
||||||
onChange={val => rows.actions.updateRow(row._id, column.name, val)}
|
onChange={val => rows.actions.updateRow(row._id, column.name, val)}
|
||||||
readonly={column.schema.autocolumn}
|
readonly={column.schema.autocolumn}
|
||||||
/>
|
/>
|
||||||
</SheetCell>
|
</SheetCell>
|
||||||
|
|
Loading…
Reference in New Issue