summaryrefslogtreecommitdiff
path: root/pages/index.tsx
diff options
context:
space:
mode:
authorKirill Rogovoy <[email protected]>2021-07-29 19:02:17 +0300
committerKirill Rogovoy <[email protected]>2021-07-29 19:02:17 +0300
commit3713d30353a21e370011e8667a4e7a4c04bcb471 (patch)
treef4ab188f62d3644862a5bee6187b92a35d482aa6 /pages/index.tsx
parent0f9f3daa3b1cd4bd1a795c61aa9fa3abf5c2ed5e (diff)
onBackgroundClick: don't cause unneccessary rerenders + reset hoverNode
Diffstat (limited to 'pages/index.tsx')
-rw-r--r--pages/index.tsx4
1 files changed, 4 insertions, 0 deletions
diff --git a/pages/index.tsx b/pages/index.tsx
index 6fc83e2..d32ebc4 100644
--- a/pages/index.tsx
+++ b/pages/index.tsx
@@ -641,6 +641,10 @@ export const Graph = forwardRef(function (props: GraphProps, graphRef: any) {
}))
},
onBackgroundClick: () => {
+ setHoverNode(null)
+ if (scope.nodeIds.length === 0) {
+ return
+ }
setScope((currentScope) => ({
...currentScope,
nodeIds: [],