Fix problem with AskForInput when there's no native text input dialog (iOS, Mac, Linux)

This commit is contained in:
Henrik Rydgård
2026-05-04 15:05:30 +02:00
parent ea4c46f27c
commit cf1bd807c7
+3 -1
View File
@@ -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);
}
}