From afe7c2fced6ae75f2d52792b37ebee4af41508fc Mon Sep 17 00:00:00 2001 From: Rohit Date: Wed, 12 Feb 2025 23:03:49 +0530 Subject: [PATCH] feat: maintain input type for fields --- .../workflow-management/classes/Generator.ts | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/server/src/workflow-management/classes/Generator.ts b/server/src/workflow-management/classes/Generator.ts index ff556359..fc732e60 100644 --- a/server/src/workflow-management/classes/Generator.ts +++ b/server/src/workflow-management/classes/Generator.ts @@ -1168,12 +1168,18 @@ export class WorkflowGenerator { const [selector, encryptedKey, type] = condition.args; const key = decrypt(encryptedKey); - let state = inputStates.get(selector) || { - selector, - value: '', - type: type || 'text', - cursorPosition: -1 - }; + let state = inputStates.get(selector); + if (!state) { + state = { + selector, + value: '', + type: type || 'text', // Use the type from the press action + cursorPosition: -1 + }; + } else { + // Update type from the press action if it exists + state.type = type || state.type; + } if (key.length === 1) { if (state.cursorPosition === -1) {