Skip to content

Commit

Permalink
Avoid resetting scroll position after clicking a node in the graph vi…
Browse files Browse the repository at this point in the history
…ewer
  • Loading branch information
asgerf committed Nov 20, 2024
1 parent 9a0bff6 commit 99175e7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion extensions/ql-vscode/src/view/results/Graph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ export function Graph({ graphData, databaseUri }: GraphProps) {
d.attributes["xlink:href"] = "#";
d.attributes["href"] = "#";
loc.uri = `file://${loc.uri}`;
select(this).on("click", () => jumpToLocation(loc, databaseUri));
select(this).on("click", (event: Event) => {
jumpToLocation(loc, databaseUri);
event.preventDefault(); // Avoid resetting scroll position
});
}
}
if ("fill" in d.attributes) {
Expand Down

0 comments on commit 99175e7

Please sign in to comment.