Skip to content

Commit 559f3aa

Browse files
authored
chore: focus selectedNode when the network is locked (#318)
1 parent 84f5875 commit 559f3aa

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

workspaces/vis-network/src/network.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,11 @@ export default class NodeSecureNetwork {
329329

330330

331331
this.nodes.update(Object.values(allNodes));
332+
this.network.focus(selectedNode, {
333+
animation: true,
334+
scale: 0.35,
335+
offset: { x: 250, y: 0 }
336+
});
332337
this.network.stopSimulation();
333338

334339
return true;
@@ -421,7 +426,11 @@ export default class NodeSecureNetwork {
421426
}
422427

423428
// offset set to 250 to compensate for the package info slide in on the left of screen
424-
this.network.focus(selectedNode, { animation: true, scale: 0.35, offset: { x: 250, y: 0 } });
429+
this.network.focus(selectedNode, {
430+
animation: true,
431+
scale: 0.35,
432+
offset: { x: 250, y: 0 }
433+
});
425434
}
426435
else if (this.highlightEnabled) {
427436
this.highlightEnabled = false;

0 commit comments

Comments
 (0)