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); } }