Skip to content
Snippets Groups Projects
Commit 2938f1a5 authored by Maximilian Giller's avatar Maximilian Giller :squid:
Browse files

Replaced selectNode changes with proper function calls

parent 51bb2af4
No related branches found
No related tags found
1 merge request!2Implemented editor in the react framework
Pipeline #56731 passed
......@@ -52,6 +52,7 @@ export class Editor extends React.PureComponent<propTypes, stateTypes> {
this.handleNodeDrag = this.handleNodeDrag.bind(this);
this.handleNodeDragEnd = this.handleNodeDragEnd.bind(this);
this.handleLinkClick = this.handleLinkClick.bind(this);
this.selectNode = this.selectNode.bind(this);
this.renderer = React.createRef();
......@@ -174,9 +175,7 @@ export class Editor extends React.PureComponent<propTypes, stateTypes> {
* Propagates the changed state of the graph.
*/
private onHistoryChange() {
this.setState({
selectedNode: undefined,
});
this.selectNode(undefined);
this.forceUpdate();
}
......@@ -334,9 +333,7 @@ export class Editor extends React.PureComponent<propTypes, stateTypes> {
}
private handleNodeDrag(node: Node, translate: positionTranslate) {
this.setState({
selectedNode: node,
});
this.selectNode(node);
const closest = this.state.graph.getClosestOtherNode(node);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment