From 52d0f7eef9a92df891669806bca2332cb2be136b Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Sun, 12 Jun 2022 13:03:01 +0800 Subject: [PATCH] Fix scene tree dock focus after using "Add Child Node" button --- editor/scene_tree_dock.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index b79609c61..5c4160bb1 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -2395,7 +2395,7 @@ void SceneTreeDock::_create() { _do_reparent(last_created, -1, nodes, true); } - scene_tree->get_scene_tree()->grab_focus(); + scene_tree->get_scene_tree()->call_deferred("grab_focus"); } void SceneTreeDock::replace_node(Node *p_node, Node *p_by_node, bool p_keep_properties, bool p_remove_old) {