From da518857ad35e14a15aa651b9a0582f38cd86a07 Mon Sep 17 00:00:00 2001 From: Jatin Bharti Date: Thu, 29 Jan 2026 04:06:17 +0530 Subject: [PATCH] Fix selection jumping back to previously selected node after its drag abort, upon clicking to select a new node (#3696) * fix : Selection jumps back to previously selected node after its drag abort, upon clicking to select new node * fix : Selection jumps back to previously selected node after its drag abort via esc key, upon clicking to select new node --- .../messages/portfolio/document/document_message_handler.rs | 1 + .../document/node_graph/node_graph_message_handler.rs | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/editor/src/messages/portfolio/document/document_message_handler.rs b/editor/src/messages/portfolio/document/document_message_handler.rs index a0176d79..330fe16a 100644 --- a/editor/src/messages/portfolio/document/document_message_handler.rs +++ b/editor/src/messages/portfolio/document/document_message_handler.rs @@ -480,6 +480,7 @@ impl MessageHandler> for DocumentMes if self.node_graph_handler.drag_start.is_some() { responses.add(DocumentMessage::AbortTransaction); self.node_graph_handler.drag_start = None; + self.node_graph_handler.select_if_not_dragged = None; } // Abort box selection else if self.node_graph_handler.box_selection_start.is_some() { diff --git a/editor/src/messages/portfolio/document/node_graph/node_graph_message_handler.rs b/editor/src/messages/portfolio/document/node_graph/node_graph_message_handler.rs index c26b21af..b0439072 100644 --- a/editor/src/messages/portfolio/document/node_graph/node_graph_message_handler.rs +++ b/editor/src/messages/portfolio/document/node_graph/node_graph_message_handler.rs @@ -74,7 +74,7 @@ pub struct NodeGraphMessageHandler { disconnecting: Option, initial_disconnecting: bool, /// Node to select on pointer up if multiple nodes are selected and they were not dragged. - select_if_not_dragged: Option, + pub select_if_not_dragged: Option, /// The start of the dragged line (cannot be moved), stored in node graph coordinates. pub wire_in_progress_from_connector: Option, /// The end point of the dragged line (cannot be moved), stored in node graph coordinates. @@ -778,6 +778,7 @@ impl<'a> MessageHandler> for NodeG // Abort dragging a node if self.drag_start.is_some() { self.drag_start = None; + self.select_if_not_dragged = None; responses.add(DocumentMessage::AbortTransaction); responses.add(NodeGraphMessage::SelectedNodesSet { nodes: self.selection_before_pointer_down.clone(),