diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 2c6b770d330..b46ce753ed1 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -112,6 +112,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; }