From 7182f14c742b8d14ccfc26921b0b9e82bd183290 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tao=20Bror=20Bojl=C3=A9n?= Date: Thu, 6 Dec 2018 16:46:44 +0000 Subject: [PATCH] fix dragging causing instance deselect (#2) (#20) --- frontend/src/components/Graph.jsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/Graph.jsx b/frontend/src/components/Graph.jsx index 595eb5f..2769a91 100644 --- a/frontend/src/components/Graph.jsx +++ b/frontend/src/components/Graph.jsx @@ -46,13 +46,20 @@ class GraphImpl extends React.Component { settings={SETTINGS} style={STYLE} onClickNode={(e) => this.props.selectAndLoadInstance(e.data.node.label)} - onClickStage={(e) => this.props.selectAndLoadInstance(null)} + onClickStage={this.onClickStage} > ) } + + onClickStage = (e) => { + // Deselect the instance (unless this was a drag event) + if (!e.data.captor.isDragging) { + this.props.selectAndLoadInstance(null); + } + } } const mapStateToProps = (state) => ({