cherry-pick #7863 83e4a124e2a6727651d82acd49eb1854b4f105ac

This commit is contained in:
David Tsay 2024-10-21 15:50:23 -07:00
parent 50e60e7824
commit 9cfbb966e2

View File

@ -150,13 +150,13 @@ export default class TableRowCollection extends EventEmitter {
}
insertOrUpdateRows(rowsToAdd, addToBeginning) {
rowsToAdd.forEach((row) => {
rowsToAdd.forEach((row, addRowsIndex) => {
const index = this.getInPlaceUpdateIndex(row);
if (index > -1) {
this.updateRowInPlace(row, index);
} else {
if (addToBeginning) {
this.rows.unshift(row);
this.rows.splice(addRowsIndex, 0, row);
} else {
this.rows.push(row);
}