diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index bf456cd0485..ea6dbebd3bd 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -120,6 +120,10 @@ void TreeItem::_change_tree(Tree *p_tree) { } if (tree->selected_item == this) { + for (int i = 0; i < tree->selected_item->cells.size(); i++) { + tree->selected_item->cells.write[i].selected = false; + } + tree->selected_item = nullptr; }