mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 02:40:49 +00:00
LibWeb: Add the HTMLInputElement.type attribute
This makes React react to change events on text <input> elements. :^)
This commit is contained in:
@@ -219,4 +219,18 @@ void HTMLInputElement::did_remove_attribute(FlyString const& name)
|
||||
}
|
||||
}
|
||||
|
||||
String HTMLInputElement::type() const
|
||||
{
|
||||
// FIXME: This should only reflect known values.
|
||||
auto value = attribute(HTML::AttributeNames::type);
|
||||
if (value.is_null())
|
||||
return "text";
|
||||
return value;
|
||||
}
|
||||
|
||||
void HTMLInputElement::set_type(String const& type)
|
||||
{
|
||||
set_attribute(HTML::AttributeNames::type, type);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user