Skip to content

Commit ede41af

Browse files
fix(selector): remove subblock state prop for subblock component (#2151)
1 parent cb0c55c commit ede41af

File tree

2 files changed

+3
-3
lines changed
  • apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor

2 files changed

+3
-3
lines changed

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/sub-block.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,10 +346,11 @@ function SubBlockComponent({
346346
| undefined
347347

348348
// Use dependsOn gating to compute final disabled state
349+
// Only pass previewContextValues when in preview mode to avoid format mismatches
349350
const { finalDisabled: gatedDisabled } = useDependsOnGate(blockId, config, {
350351
disabled,
351352
isPreview,
352-
previewContextValues: subBlockValues,
353+
previewContextValues: isPreview ? subBlockValues : undefined,
353354
})
354355

355356
const isDisabled = gatedDisabled
@@ -611,7 +612,7 @@ function SubBlockComponent({
611612
disabled={isDisabled}
612613
isPreview={isPreview}
613614
previewValue={previewValue}
614-
previewContextValues={subBlockValues}
615+
previewContextValues={isPreview ? subBlockValues : undefined}
615616
/>
616617
)
617618

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/editor.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,6 @@ export function Editor() {
353353
blockId={currentBlockId}
354354
config={subBlock}
355355
isPreview={false}
356-
subBlockValues={subBlockState}
357356
disabled={!userPermissions.canEdit}
358357
fieldDiffStatus={undefined}
359358
allowExpandInPreview={false}

0 commit comments

Comments
 (0)