Skip to content

Commit

Permalink
added moving to node when searching
Browse files Browse the repository at this point in the history
  • Loading branch information
mikedegeofroy committed Dec 1, 2024
1 parent cdfe6e3 commit b4b55ef
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/components/tree/flow.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,9 @@ const Flow = () => {

useEffect(() => {
if (selected) {
console.log(selected);
fitView({ nodes: [selected], duration: 800 });
}
}, [fitView, getViewport, selected, setViewport]);
}, [fitView, getViewport, selected, setViewport, nodes]);

useEffect(() => {
getPersonNodeById('7').then((x) => {
Expand All @@ -58,7 +57,7 @@ const Flow = () => {
setNodes(nodes);
setEdges(edges);
});
}, [setEdges, setNodes, fitView]);
}, [setEdges, setNodes]);

return (
<ReactFlow
Expand Down

0 comments on commit b4b55ef

Please sign in to comment.