Skip to content

Commit 5c911af

Browse files
committed
fix(tag-drop): prevent duplicate TagDropdown for object/array types
1 parent e7cb7d5 commit 5c911af

File tree

1 file changed

+19
-16
lines changed
  • apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/variables-input

1 file changed

+19
-16
lines changed

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

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -641,22 +641,25 @@ export function VariablesInput({
641641
</div>
642642
)}
643643

644-
{showTags && activeFieldId === assignment.id && (
645-
<TagDropdown
646-
visible={showTags}
647-
onSelect={handleTagSelect}
648-
blockId={blockId}
649-
activeSourceBlockId={activeSourceBlockId}
650-
inputValue={assignment.value || ''}
651-
cursorPosition={cursorPosition}
652-
onClose={() => setShowTags(false)}
653-
inputRef={
654-
{
655-
current: valueInputRefs.current[assignment.id] || null,
656-
} as React.RefObject<HTMLTextAreaElement | HTMLInputElement>
657-
}
658-
/>
659-
)}
644+
{showTags &&
645+
activeFieldId === assignment.id &&
646+
assignment.type !== 'object' &&
647+
assignment.type !== 'array' && (
648+
<TagDropdown
649+
visible={showTags}
650+
onSelect={handleTagSelect}
651+
blockId={blockId}
652+
activeSourceBlockId={activeSourceBlockId}
653+
inputValue={assignment.value || ''}
654+
cursorPosition={cursorPosition}
655+
onClose={() => setShowTags(false)}
656+
inputRef={
657+
{
658+
current: valueInputRefs.current[assignment.id] || null,
659+
} as React.RefObject<HTMLTextAreaElement | HTMLInputElement>
660+
}
661+
/>
662+
)}
660663
</div>
661664
</div>
662665
)}

0 commit comments

Comments
 (0)