Skip to content

Commit

Permalink
🐛 fix(common): clear selected state brefore new node is selected
Browse files Browse the repository at this point in the history
  • Loading branch information
萌萌的老胖子 committed May 18, 2020
1 parent 87645c5 commit 77a0cc1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/graphin/src/behaviors/graphin-highlight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@ export default {
// eslint-disable-next-line
const { graph } = this as any;
graph.getNodes().forEach((node: NodeData) => {
graph.clearItemStates(node, ['highlight.source', 'highlight.target', 'highlight.dark', 'highlight.light']);
graph.clearItemStates(node, [
'selected',
'highlight.source',
'highlight.target',
'highlight.dark',
'highlight.light',
]);
});
graph.getEdges().forEach((edge: EdgeData) => {
graph.clearItemStates(edge, ['selected']);
Expand Down Expand Up @@ -129,6 +135,7 @@ export default {
});
} else {
// 按住ctrl 多选

relativeEdges.forEach((edge: IEdge) => {
graph.setItemState(edge, 'highlight.dark', false);
graph.setItemState(edge, 'highlight.light', true);
Expand Down

0 comments on commit 77a0cc1

Please sign in to comment.