Skip to content

Commit 9fe82b1

Browse files
authored
Fix canvas field deletion in read-only mode (#697)
1 parent 9df18ec commit 9fe82b1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/components/EditorCanvas/Table.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,11 @@ export default function Table({
434434
backgroundColor: "#d42020b3",
435435
}}
436436
icon={<IconMinus />}
437-
onClick={() => deleteField(fieldData, tableData.id)}
437+
disabled={layout.readOnly}
438+
onClick={() => {
439+
if (layout.readOnly) return;
440+
deleteField(fieldData, tableData.id);
441+
}}
438442
/>
439443
) : settings.showDataTypes ? (
440444
<div className="flex gap-1 items-center">

0 commit comments

Comments
 (0)