1
0
Fork 0
mirror of synced 2024-09-08 05:31:47 +12:00

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) {
return
}
if ($selectedCellAPI?.isReadonly()) {
return
}
const [rowId, column] = $selectedCellId.split("-")
rows.actions.updateRow(rowId, column, null)
}, 100)

View file

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