Commit 0d526b83 authored by Harlan's avatar Harlan Committed by hetech

Table: current row will set to the row which has the same row-key when data changes(#3023) (#13200)

parent bc26ab6b
......@@ -597,6 +597,20 @@ TableStore.prototype.updateCurrentRow = function() {
const oldCurrentRow = states.currentRow;
if (data.indexOf(oldCurrentRow) === -1) {
if (states.rowKey && oldCurrentRow) {
let newCurrentRow = null;
for (let i = 0; i < data.length; i++) {
const item = data[i];
if (item && item[states.rowKey] === oldCurrentRow[states.rowKey]) {
newCurrentRow = item;
break;
}
}
if (newCurrentRow) {
states.currentRow = newCurrentRow;
return;
}
}
states.currentRow = null;
if (states.currentRow !== oldCurrentRow) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment