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