Skip to content

Commit 8cc5d9b

Browse files
committed
Do not fit view to graph when filter is cleared
It's quite a jarring user experience to zoom right back out to see the whole graph after clearing the filter term, so avoid this from happening.
1 parent 5f84bdd commit 8cc5d9b

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

templates/graph.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,11 @@ <h2 id="sidebar-title">No node selected</h2>
181181
selectedNodes.unselect();
182182
resetSidebar();
183183
}
184-
fitViewToNodes(cy.nodes(':visible'));
184+
185+
186+
if (filterTerm !== '') {
187+
fitViewToNodes(cy.nodes(':visible'));
188+
}
185189
}
186190

187191
async function loadGraph() {

0 commit comments

Comments
 (0)