Ver Fonte

fix: condition row right clear (#963)

Yiwei Mao há 2 meses atrás
pai
commit
0a2c727bc0

+ 4 - 0
packages/materials/form-materials/src/components/condition-context/hooks/use-condition.tsx

@@ -125,6 +125,10 @@ export function useCondition({
 
   // When type of target schema updated, clear it
   useEffect(() => {
+    if (!prevTargetSchemaRef.current) {
+      prevTargetSchemaRef.current = targetSchema;
+      return;
+    }
     if (prevTargetSchemaRef.current?.type !== targetSchema?.type) {
       onClearRight?.();
     }