mirror of
https://github.com/smartxworks/sunmao-ui.git
synced 2025-02-23 17:49:49 +08:00
fix(Tree): fix the error caused by changing data in multi-select mode
This commit is contained in:
parent
819dad3ada
commit
d1cfc023a3
@ -137,10 +137,14 @@ export const Tree = implementRuntimeComponent({
|
||||
e: Event;
|
||||
}
|
||||
) => {
|
||||
const selectNodes = extra.selectedNodes.map(node => formatNode(node.props));
|
||||
// In multi-select mode, select an item, remove it from data, and select an item again. Two items will be selected at the same time
|
||||
// Think it's a bug in the arco tree
|
||||
const selectNodes = extra.selectedNodes
|
||||
.filter(node => node)
|
||||
.map(node => formatNode(node.props));
|
||||
|
||||
mergeState({
|
||||
selectedKeys,
|
||||
selectedKeys: selectNodes.map(node => node.key),
|
||||
selectedNode: selectNodes[0],
|
||||
selectedNodes: selectNodes,
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user