diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 01a1c9ebbf..4d75ae7fbb 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -5160,7 +5160,10 @@ void Tree::_notification(int p_what) { } break; case NOTIFICATION_VISIBILITY_CHANGED: { - drag_touching = false; + if (!is_visible()) { + drag_touching = false; + popup_editor->hide(); + } } break; case NOTIFICATION_DRAG_END: { @@ -5642,7 +5645,7 @@ void Tree::_notification(int p_what) { case NOTIFICATION_RESIZED: case NOTIFICATION_TRANSFORM_CHANGED: { - if (popup_edited_item != nullptr) { + if (popup_edited_item != nullptr && popup_editor->is_visible()) { Rect2 rect = _get_item_focus_rect(popup_edited_item); popup_editor->set_position(get_screen_position() + rect.position);