From 45dec7a4cc5df30a9385d2706f6091a94c6853b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A8=E6=AC=A3?= Date: Thu, 5 Sep 2024 01:18:13 +0800 Subject: [PATCH] refactor: Improve input handling in AddFlowVariableModal --- .../flow/canvas-modal/add-flow-variable-modal.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/web/components/flow/canvas-modal/add-flow-variable-modal.tsx b/web/components/flow/canvas-modal/add-flow-variable-modal.tsx index 5bd2997cb..8da9e50c4 100644 --- a/web/components/flow/canvas-modal/add-flow-variable-modal.tsx +++ b/web/components/flow/canvas-modal/add-flow-variable-modal.tsx @@ -143,9 +143,16 @@ export const AddFlowVariableModal: React.FC = ({ flowInfo, setFlowInfo }) case 'str': return ; case 'int': - return ; + return ( + value?.replace(/[^\-?\d]/g, '') || 0} + style={{ width: '100%' }} + /> + ); case 'float': - return ; + return ; case 'bool': return (