From b362a112c6db7c5a6b3bcef9fdb08fb8e029723d Mon Sep 17 00:00:00 2001 From: jassybiju Date: Mon, 12 Jan 2026 10:39:03 +0530 Subject: [PATCH] prevent node from continuously changing position on hovering --- src/pages/DsaVisualization.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/DsaVisualization.jsx b/src/pages/DsaVisualization.jsx index 5caefa3..74fe338 100644 --- a/src/pages/DsaVisualization.jsx +++ b/src/pages/DsaVisualization.jsx @@ -386,7 +386,7 @@ const GraphVisualizer = ({ algorithmName, isPlaying, setIsPlaying, speed, onFini const isVisited = visualState.visited.has(node.id); const isPath = visualState.path.has(node.id); const dist = visualState.dists[node.id]; - return ( handleMouseDown(e, node.id)} onClick={() => editMode === 'move' && setEndNode(node.id)} onContextMenu={(e) => handleNodeContext(e, node.id)}>{node.id}{(algorithmName === 'Dijkstra' || algorithmName === 'AStar') && dist !== undefined && ({dist === Infinity ? '∞' : dist})}); + return ( handleMouseDown(e, node.id)} onClick={() => editMode === 'move' && setEndNode(node.id)} onContextMenu={(e) => handleNodeContext(e, node.id)}>{node.id}{(algorithmName === 'Dijkstra' || algorithmName === 'AStar') && dist !== undefined && ({dist === Infinity ? '∞' : dist})}); })}