Skip to content

Commit 21174d8

Browse files
author
priyanshu.solanki
committed
fix: clear value when switching tag field type
- Reset value to empty when changing type (e.g., boolean to text) - Reset value when tag name changes and type differs - Prevents 'true'/'false' from sticking in text inputs
1 parent c23d6db commit 21174d8

File tree

1 file changed

+9
-0
lines changed
  • apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/document-tag-entry

1 file changed

+9
-0
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,18 @@ export function DocumentTagEntry({
160160
)
161161
if (tagDef) {
162162
newCells.type = tagDef.fieldType
163+
// Clear value when tag type changes
164+
if (row.cells.type !== tagDef.fieldType) {
165+
newCells.value = ''
166+
}
163167
}
164168
}
165169

170+
// Clear value when type changes (e.g., switching from boolean to text)
171+
if (column === 'type' && row.cells.type !== value) {
172+
newCells.value = ''
173+
}
174+
166175
return {
167176
...row,
168177
cells: newCells,

0 commit comments

Comments
 (0)