Skip to content
This repository has been archived by the owner on Jan 2, 2025. It is now read-only.

Commit

Permalink
Merge pull request bonsai-rx#1760 from glopesdev/issue-1759
Browse files Browse the repository at this point in the history
Prevent empty category nodes from being dragged into the workflow
  • Loading branch information
glopesdev authored Apr 27, 2024
2 parents d829231 + a10d27f commit d3317bb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Bonsai.Editor/EditorForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1541,7 +1541,9 @@ protected override void OnDeactivate(EventArgs e)

private void toolboxTreeView_ItemDrag(object sender, ItemDragEventArgs e)
{
if (e.Item is TreeNode selectedNode && selectedNode.GetNodeCount(false) == 0)
if (e.Item is TreeNode selectedNode &&
selectedNode.Tag is not null &&
selectedNode.GetNodeCount(false) == 0)
{
toolboxTreeView.DoDragDrop(selectedNode, DragDropEffects.Copy);
}
Expand Down

0 comments on commit d3317bb

Please sign in to comment.