From 56e7bc1e51af8bf5ad7a4921592c83c9a4946f7c Mon Sep 17 00:00:00 2001 From: Abhinav Anil Date: Fri, 15 Mar 2024 19:56:02 +0530 Subject: [PATCH] input-field: fix missing `fail_text` when `placeholder_text` is empty (#192) * input-field: fix missing fail text when placeholder is empty * comments --- src/renderer/widgets/PasswordInputField.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/renderer/widgets/PasswordInputField.cpp b/src/renderer/widgets/PasswordInputField.cpp index 9502175..4aad26c 100644 --- a/src/renderer/widgets/PasswordInputField.cpp +++ b/src/renderer/widgets/PasswordInputField.cpp @@ -47,7 +47,10 @@ CPasswordInputField::CPasswordInputField(const Vector2D& viewport_, const std::u g_pHyprlock->m_bNumLock = outerColor.invertNum; std::string placeholderText = std::any_cast(props.at("placeholder_text")); - if (!placeholderText.empty()) { + + // Render placeholder if either placeholder_text or fail_text are non-empty + // as placeholder must be rendered to show fail_text + if (!placeholderText.empty() || !configFailText.empty()) { placeholder.resourceID = "placeholder:" + std::to_string((uintptr_t)this); CAsyncResourceGatherer::SPreloadRequest request; request.id = placeholder.resourceID;