mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-20 01:01:54 +00:00
LibWeb: Hide inner text of input element when showing placeholder
This commit is contained in:
parent
b4bae912c9
commit
4205ac778f
Notes:
sideshowbarker
2024-07-17 02:21:14 +09:00
Author: https://github.com/bplaat
Commit: 4205ac778f
Pull-request: https://github.com/SerenityOS/serenity/pull/23551
Reviewed-by: https://github.com/trflynn89
4 changed files with 68 additions and 4 deletions
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue