mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 14:28: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:
parent
5f54b8dd6c
commit
2660795bcf
Notes:
sideshowbarker
2024-07-17 18:38:01 +09:00
Author: https://github.com/awesomekling
Commit: 2660795bcf
3 changed files with 19 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue