AykutSarac 2 роки тому
батько
коміт
393cd7ec59
1 змінених файлів з 6 додано та 0 видалено
  1. 6 0
      src/components/Graph/index.tsx

+ 6 - 0
src/components/Graph/index.tsx

@@ -79,6 +79,11 @@ const MemoizedGraph = React.memo(function Layout({
     }
   }, []);
 
+  const onCanvasClick = React.useCallback(() => {
+    const input = document.querySelector("input:focus") as HTMLInputElement;
+    if (input) input.blur();
+  }, []);
+
   React.useEffect(() => {
     const { nodes, edges } = parser(json, expand);
 
@@ -111,6 +116,7 @@ const MemoizedGraph = React.memo(function Layout({
             maxHeight={size.height}
             direction={layout}
             onLayoutChange={onLayoutChange}
+            onCanvasClick={onCanvasClick}
             key={layout}
             zoomable={false}
             animated={false}