Merge pull request #3833 from asgerf/asgerf/graph-viewer-scrollpos

Avoid resetting scroll position after clicking a node in the graph viewer
This commit is contained in:
Asger F
2024-11-22 10:19:27 +01:00
committed by GitHub

View File

@@ -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) {