Sfoglia il codice sorgente

fix(form): Fix index comparison error when sorting field array. (#486)

Demo Jx 6 mesi fa
parent
commit
9be663f738

+ 1 - 1
packages/node-engine/form/src/core/field-array-model.ts

@@ -38,7 +38,7 @@ export class FieldArrayModel<TValue = FieldValue> extends FieldModel<Array<TValu
       const p1 = f1.path.value;
       const p1 = f1.path.value;
       const p2 = f2.path.value;
       const p2 = f2.path.value;
       const i1 = parseInt(p1[p1.length - 1]);
       const i1 = parseInt(p1[p1.length - 1]);
-      const i2 = parseInt(p1[p2.length - 1]);
+      const i2 = parseInt(p2[p2.length - 1]);
       return i1 - i2;
       return i1 - i2;
     });
     });
   }
   }