diff --git a/src/editor/js/components/editor.tsx b/src/editor/js/components/editor.tsx
index 5ae9121eae0a5f35cf8972387b23d9fcb2ae19e5..eb0e9cd5f85663a84c3a00bf6999e1724b042e61 100644
--- a/src/editor/js/components/editor.tsx
+++ b/src/editor/js/components/editor.tsx
@@ -179,7 +179,13 @@ export class Editor extends React.PureComponent<propTypes, stateTypes> {
      * Propagates the changed state of the graph.
      */
     private onHistoryChange() {
-        this.selectNode(undefined);
+        if (this.state.selectedNode === undefined) {
+            this.selectNode(undefined);
+        } else {
+            this.selectNode(
+                this.state.graph.getNode(this.state.selectedNode.id)
+            );
+        }
         this.forceUpdate();
     }