From 20d5b7ca6da760afca1b400642e07d112f31df4d Mon Sep 17 00:00:00 2001 From: Maximilian Seidler Date: Fri, 17 Apr 2026 16:05:21 +0200 Subject: [PATCH] input-field: fix placeholder not updating correctly Bug introduced in #959, reference made the config text be overwritten --- src/renderer/widgets/PasswordInputField.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/renderer/widgets/PasswordInputField.cpp b/src/renderer/widgets/PasswordInputField.cpp index 67f05b4..37fd410 100644 --- a/src/renderer/widgets/PasswordInputField.cpp +++ b/src/renderer/widgets/PasswordInputField.cpp @@ -343,16 +343,15 @@ void CPasswordInputField::updatePlaceholder() { if (displayFail && placeholder.failedAttempts == g_pAuth->getFailedAttempts()) return; - std::string& templateText = configPlaceholderText; + std::string newText = ""; if (displayFail) { - templateText = configFailText; + newText = formatString(configFailText).formatted; placeholder.failedAttempts = g_pAuth->getFailedAttempts(); - } else if (checkWaiting && !configCheckText.empty()) { - templateText = configCheckText; - } - - const std::string newText = formatString(templateText).formatted; + } else if (checkWaiting && !configCheckText.empty()) + newText = formatString(configCheckText).formatted; + else + newText = formatString(configPlaceholderText).formatted; // if the text is unchanged we don't need to do anything, unless we are swapping font color const auto ALLOWCOLORSWAP = outThick == 0 && colorConfig.swapFont;