mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-03 21:12:08 +02:00
LibWeb: Add the HTMLInputElement.type attribute
This makes React react to change events on text <input> elements. :^)
This commit is contained in:
Notes:
sideshowbarker
2024-07-17 18:38:01 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/2660795bcf
@@ -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