Skip to content

Commit 99175e7

Browse files
committed
Avoid resetting scroll position after clicking a node in the graph viewer
1 parent 9a0bff6 commit 99175e7

File tree

1 file changed

+4
-1
lines changed
  • extensions/ql-vscode/src/view/results

1 file changed

+4
-1
lines changed

extensions/ql-vscode/src/view/results/Graph.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ export function Graph({ graphData, databaseUri }: GraphProps) {
4848
d.attributes["xlink:href"] = "#";
4949
d.attributes["href"] = "#";
5050
loc.uri = `file://${loc.uri}`;
51-
select(this).on("click", () => jumpToLocation(loc, databaseUri));
51+
select(this).on("click", (event: Event) => {
52+
jumpToLocation(loc, databaseUri);
53+
event.preventDefault(); // Avoid resetting scroll position
54+
});
5255
}
5356
}
5457
if ("fill" in d.attributes) {

0 commit comments

Comments
 (0)