mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 10:07:15 +02:00
LibWeb: Hide inner text of input element when showing placeholder
This commit is contained in:
committed by
Tim Flynn
parent
b4bae912c9
commit
4205ac778f
Notes:
sideshowbarker
2024-07-17 02:21:14 +09:00
Author: https://github.com/bplaat Commit: https://github.com/SerenityOS/serenity/commit/4205ac778f Pull-request: https://github.com/SerenityOS/serenity/pull/23551 Reviewed-by: https://github.com/trflynn89
@@ -398,8 +398,10 @@ void HTMLTextAreaElement::update_placeholder_visibility()
|
||||
auto placeholder_text = get_attribute(AttributeNames::placeholder);
|
||||
if (placeholder_text.has_value() && m_text_node->data().is_empty()) {
|
||||
MUST(m_placeholder_element->style_for_bindings()->set_property(CSS::PropertyID::Display, "block"sv));
|
||||
MUST(m_inner_text_element->style_for_bindings()->set_property(CSS::PropertyID::Display, "none"sv));
|
||||
} else {
|
||||
MUST(m_placeholder_element->style_for_bindings()->set_property(CSS::PropertyID::Display, "none"sv));
|
||||
MUST(m_inner_text_element->style_for_bindings()->set_property(CSS::PropertyID::Display, "block"sv));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user