Skip to content

Commit

Permalink
fix: 框选优化
Browse files Browse the repository at this point in the history
  • Loading branch information
jifeng committed Apr 8, 2024
1 parent 1f18ae7 commit a67131f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/lib/components/topology/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1342,14 +1342,15 @@ class Topology extends React.Component<ITopologyProps, ITopologyState> {
};

handleCanvasClick = (e: React.MouseEvent<HTMLDivElement>) => {
const { boxSelectionInfo } = this.state;
// @ts-ignore
const { className } = e.target;
if (
typeof className === "string"
&& className.includes("topology-canvas")
) {
// 当按住cmd或者ctrl的时候,左键点击背景图层的时候,不会清楚选中的数据
if (e.ctrlKey || e.metaKey) {
// 当按住cmd或者ctrl的时候,左键点击背景图层的时候,不会清除选中的数据
if (e.ctrlKey || e.metaKey || !!boxSelectionInfo) {
return;
}
this.clearSelectData();
Expand Down

0 comments on commit a67131f

Please sign in to comment.