Skip to content

Commit dba6718

Browse files
authored
Merge pull request github#3833 from asgerf/asgerf/graph-viewer-scrollpos
Avoid resetting scroll position after clicking a node in the graph viewer
2 parents 2bcdf93 + 99175e7 commit dba6718

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)