Prevent deleting autocolumns via keyboard

This commit is contained in:
Andrew Kingston 2023-03-14 12:06:33 +00:00
parent 43edf37f74
commit d25128d45a
2 changed files with 8 additions and 2 deletions

View File

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

View File

@ -20,7 +20,10 @@
$: { $: {
if (selected) { if (selected) {
selectedCellAPI.set(api) selectedCellAPI.set({
...api,
isReadonly: () => !!column.schema.autocolumn,
})
} }
} }
</script> </script>