input-field: fix missing fail_text when placeholder_text is empty (#192)

* input-field: fix missing fail text when placeholder is empty

* comments
This commit is contained in:
Abhinav Anil 2024-03-15 19:56:02 +05:30 committed by GitHub
parent 1c92c6109c
commit 56e7bc1e51
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -47,7 +47,10 @@ CPasswordInputField::CPasswordInputField(const Vector2D& viewport_, const std::u
g_pHyprlock->m_bNumLock = outerColor.invertNum;
std::string placeholderText = std::any_cast<Hyprlang::STRING>(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;