Skip to content

Commit

Permalink
Merge pull request #3833 from asgerf/asgerf/graph-viewer-scrollpos
Browse files Browse the repository at this point in the history
Avoid resetting scroll position after clicking a node in the graph viewer
  • Loading branch information
asgerf authored Nov 22, 2024
2 parents 2bcdf93 + 99175e7 commit dba6718
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 dba6718

Please sign in to comment.