Forráskód Böngészése

initValue ->value

visuddhinanda 2 éve
szülő
commit
134a89e1a6

+ 12 - 1
dashboard/src/components/template/SentEdit/SentCanRead.tsx

@@ -146,10 +146,21 @@ const SentCanReadWidget = ({
       {sentData.map((item, id) => {
       {sentData.map((item, id) => {
         return (
         return (
           <SentCell
           <SentCell
-            initValue={item}
+            value={item}
             key={id}
             key={id}
             isPr={false}
             isPr={false}
             editMode={item.openInEditMode}
             editMode={item.openInEditMode}
+            onChange={(value: ISentence) => {
+              console.log("onChange", value);
+              setSentData((origin) => {
+                origin.forEach((value1, index, array) => {
+                  if (value1.id === value.id) {
+                    array[index] = value;
+                  }
+                });
+                return origin;
+              });
+            }}
           />
           />
         );
         );
       })}
       })}