fix: 修复 Tree 在拖拽后item使用旧的key导致的渲染异常 (#6043)

This commit is contained in:
meerkat 2023-01-10 10:56:21 +08:00 committed by GitHub
parent d0f56f4a71
commit 0340ca00a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -112,4 +112,4 @@
"printBasicPrototype": false
}
}
}
}

View File

@ -846,13 +846,13 @@ export class TreeSelector extends React.Component<
}
if (paths.length === 1) {
// 父节点
item.key = item.key || key;
item.key = key;
flattenedOptions.push(item);
} else if (this.isUnfolded(parent)) {
this.relations.set(item, parent);
// 父节点是展开的状态
item.level = level;
item.key = item.key || `${parent.key}-${key}`;
item.key = `${parent.key}-${key}`;
flattenedOptions.push(item);
}
}

View File

@ -236,4 +236,4 @@
"react-dom": ">=16.8.6"
},
"gitHead": "37d23b4a8eb1c663bc38e8dd9040889ea1526ec4"
}
}