diff options
-rw-r--r-- | editor/scene_tree_editor.cpp | 4 | ||||
-rw-r--r-- | scene/gui/tree.cpp | 4 | ||||
-rw-r--r-- | scene/gui/tree.h | 1 |
3 files changed, 9 insertions, 0 deletions
diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp index f979f61196..d0bf83eb2d 100644 --- a/editor/scene_tree_editor.cpp +++ b/editor/scene_tree_editor.cpp @@ -540,6 +540,10 @@ void SceneTreeEditor::_update_tree(bool p_scroll_to_selected) { return; } + if (tree->is_editing()) { + return; + } + updating_tree = true; tree->clear(); if (get_scene_node()) { diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 6404f6fc0d..00056cd912 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -3013,6 +3013,10 @@ bool Tree::edit_selected() { return false; } +bool Tree::is_editing() { + return popup_editor->is_visible(); +} + Size2 Tree::get_internal_min_size() const { Size2i size = cache.bg->get_offset(); if (root) { diff --git a/scene/gui/tree.h b/scene/gui/tree.h index a40817b752..6d36f0df7f 100644 --- a/scene/gui/tree.h +++ b/scene/gui/tree.h @@ -604,6 +604,7 @@ public: int get_item_offset(TreeItem *p_item) const; Rect2 get_item_rect(TreeItem *p_item, int p_column = -1) const; bool edit_selected(); + bool is_editing(); // First item that starts with the text, from the current focused item down and wraps around. TreeItem *search_item_text(const String &p_find, int *r_col = nullptr, bool p_selectable = false); |