diff --git a/es-app/src/guis/GuiScraperSearch.cpp b/es-app/src/guis/GuiScraperSearch.cpp index 93ff9f680..93d70ffa2 100644 --- a/es-app/src/guis/GuiScraperSearch.cpp +++ b/es-app/src/guis/GuiScraperSearch.cpp @@ -777,7 +777,16 @@ void GuiScraperSearch::updateThumbnail() void GuiScraperSearch::openInputScreen(ScraperSearchParams& params) { - auto searchForFunc = [&](const std::string& name) { + auto searchForFunc = [&](std::string name) { + // Trim leading and trailing whitespaces. + name.erase(name.begin(), std::find_if(name.begin(), name.end(), [](char c) { + return !std::isspace(static_cast(c)); + })); + name.erase(std::find_if(name.rbegin(), name.rend(), + [](char c) { return !std::isspace(static_cast(c)); }) + .base(), + name.end()); + stop(); mRefinedSearch = true; params.nameOverride = name;