diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 1ff1f4b6d80..cb5a895574e 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -2017,6 +2017,9 @@ void Viewport::_gui_input_event(Ref p_event) { top->notification(Control::NOTIFICATION_MODAL_CLOSE); top->_modal_stack_remove(); top->hide(); + // Close modal, set input as handled + get_tree()->set_input_as_handled(); + return; } }