diff --git a/Source/Editor/GUI/Tree/TreeNode.cs b/Source/Editor/GUI/Tree/TreeNode.cs
index f7e5f115a..7fdc1c746 100644
--- a/Source/Editor/GUI/Tree/TreeNode.cs
+++ b/Source/Editor/GUI/Tree/TreeNode.cs
@@ -723,12 +723,6 @@ namespace FlaxEditor.GUI.Tree
///
public override bool OnMouseUp(Vector2 location, MouseButton button)
{
- // Check if mouse hits bar
- if (button == MouseButton.Right && TestHeaderHit(ref location))
- {
- ParentTree.OnRightClickInternal(this, ref location);
- }
-
// Clear flag for left button
if (button == MouseButton.Left)
{
@@ -773,11 +767,23 @@ namespace FlaxEditor.GUI.Tree
Expand();
}
+ // Check if mouse hits bar
+ if (button == MouseButton.Right && TestHeaderHit(ref location))
+ {
+ ParentTree.OnRightClickInternal(this, ref location);
+ }
+
// Handled
Focus();
return true;
}
+ // Check if mouse hits bar
+ if (button == MouseButton.Right && TestHeaderHit(ref location))
+ {
+ ParentTree.OnRightClickInternal(this, ref location);
+ }
+
// Base
return base.OnMouseUp(location, button);
}
diff --git a/Source/Editor/Windows/Assets/PrefabWindow.Actions.cs b/Source/Editor/Windows/Assets/PrefabWindow.Actions.cs
index af568cd3f..6687bc548 100644
--- a/Source/Editor/Windows/Assets/PrefabWindow.Actions.cs
+++ b/Source/Editor/Windows/Assets/PrefabWindow.Actions.cs
@@ -41,6 +41,8 @@ namespace FlaxEditor.Windows.Assets
var newRoot = Object.Find(ref newRootId);
_window.Graph.MainActor = null;
+ _window.Viewport.Instance = null;
+
if (SceneGraphFactory.Nodes.TryGetValue(oldRootId, out var oldRootNode))
oldRootNode.Dispose();
if (SceneGraphFactory.Nodes.TryGetValue(newRootId, out var newRootNode))