From cf1bd807c7891face82ea2b3761a73e93ef1858f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Mon, 4 May 2026 15:05:30 +0200 Subject: [PATCH] Fix problem with AskForInput when there's no native text input dialog (iOS, Mac, Linux) --- Common/UI/PopupScreens.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Common/UI/PopupScreens.cpp b/Common/UI/PopupScreens.cpp index e339f45976..248169f9fe 100644 --- a/Common/UI/PopupScreens.cpp +++ b/Common/UI/PopupScreens.cpp @@ -800,7 +800,7 @@ void AskForInput(ScreenManager *screenManager, RequesterToken token, UI::View *s popupScreen->SetAlignTop(true); } popupScreen->OnChange.Add([callback, sourceView](EventParams &e) { - callback(SanitizeString(StripSpaces(*(std::string *)e.v), StringRestriction::None, 0, 0), true); + callback(SanitizeString(StripSpaces(e.s), StringRestriction::None, 0, 0), true); if (sourceView) { SetFocusedView(sourceView); } @@ -838,6 +838,7 @@ void PopupTextInputChoice::HandleClick(EventParams &e) { *value_ = StripSpaces(SanitizeString(*value_, restriction_, minLen_, maxLen_)); EventParams params{}; params.v = this; + params.s = *value_; OnChange.Trigger(params); if (restoreFocus_) { SetFocusedView(this); @@ -991,6 +992,7 @@ void TextEditPopupScreen::OnCompleted(DialogResult result) { *value_ = StripSpaces(edit_->GetText()); EventParams e{}; e.v = edit_; + e.s = *value_; OnChange.Trigger(e); } }