Skip to content

Commit fd78026

Browse files
committed
Fixed issue with unexpected additional value inside datagrid.
1 parent 1ee427a commit fd78026

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/components/datagrid/DataGrid.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,8 +349,13 @@ export default class DataGridComponent extends NestedComponent {
349349
}
350350

351351
addRow() {
352-
this.dataValue.push({});
353352
const index = this.rows.length;
353+
354+
// Handle length mismatch between rows and dataValue
355+
if (this.dataValue.length === index) {
356+
this.dataValue.push({});
357+
}
358+
354359
this.rows[index] = this.createRowComponents(this.dataValue[index], index);
355360
this.redraw();
356361
}

0 commit comments

Comments
 (0)