From af577f1f7e3d4013044185466562f7b6671c7c10 Mon Sep 17 00:00:00 2001 From: waleed Date: Wed, 14 Jan 2026 21:21:09 -0800 Subject: [PATCH] feat(starter): in start block input format, don't prevent deletion if only one field remaining, just clear form --- .../sub-block/components/starter/input-format.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/starter/input-format.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/starter/input-format.tsx index e1c6dce71c..ee15bd9c39 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/starter/input-format.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/starter/input-format.tsx @@ -125,10 +125,16 @@ export function FieldFormat({ } /** - * Removes a field by ID, preventing removal of the last field + * Removes a field by ID, or clears it if it's the last field */ const removeField = (id: string) => { - if (isReadOnly || fields.length === 1) return + if (isReadOnly) return + + if (fields.length === 1) { + setStoreValue([createDefaultField()]) + return + } + setStoreValue(fields.filter((field) => field.id !== id)) } @@ -273,7 +279,7 @@ export function FieldFormat({