diff --git a/Common/System/System.h b/Common/System/System.h index 081227589f..238ae47e25 100644 --- a/Common/System/System.h +++ b/Common/System/System.h @@ -61,6 +61,7 @@ void System_LaunchUrl(LaunchUrlType urlType, std::string_view url); enum class UIEventNotification { MENU_RETURN, POPUP_CLOSED, + DIALOG_CLOSED, TEXT_GOTFOCUS, TEXT_LOSTFOCUS, }; diff --git a/Common/UI/UIScreen.cpp b/Common/UI/UIScreen.cpp index 9cd40c855c..0e76c0f93f 100644 --- a/Common/UI/UIScreen.cpp +++ b/Common/UI/UIScreen.cpp @@ -264,6 +264,10 @@ void UIDialogScreen::sendMessage(UIMessage message, const char *value) { } } +UIDialogScreen::~UIDialogScreen() { + System_NotifyUIEvent(UIEventNotification::DIALOG_CLOSED); +} + bool UIScreen::IsOnTop() const { return screenManager()->topScreen() == this; } diff --git a/Common/UI/UIScreen.h b/Common/UI/UIScreen.h index d6da24e478..a6c09202cd 100644 --- a/Common/UI/UIScreen.h +++ b/Common/UI/UIScreen.h @@ -91,6 +91,7 @@ private: class UIDialogScreen : public UIScreen { public: UIDialogScreen() : UIScreen(), finished_(false) {} + ~UIDialogScreen() override; bool key(const KeyInput &key) override; void sendMessage(UIMessage message, const char *value) override; diff --git a/ios/ViewControllerCommon.mm b/ios/ViewControllerCommon.mm index b7eae300bf..ccf3ef3806 100644 --- a/ios/ViewControllerCommon.mm +++ b/ios/ViewControllerCommon.mm @@ -209,6 +209,7 @@ } [picker dismissViewControllerAnimated:YES completion:nil]; + [self hideKeyboard]; } diff --git a/ios/main.mm b/ios/main.mm index b442521084..75e5ef497b 100644 --- a/ios/main.mm +++ b/ios/main.mm @@ -533,6 +533,7 @@ bool System_MakeRequest(SystemRequestType type, int requestId, const std::string { switch ((UIEventNotification)param3) { case UIEventNotification::POPUP_CLOSED: + case UIEventNotification::DIALOG_CLOSED: [sharedViewController hideKeyboard]; break; case UIEventNotification::TEXT_GOTFOCUS: