mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 17:55:07 +02:00
LibWeb: Make <input type=checkbox> fire click events when clicked :^)
This makes React react to checkboxes. Apparently they ignore the "change" event in favor of "click" on checkboxes. This is a compatibility hack for IE8.
This commit is contained in:
Notes:
sideshowbarker
2024-07-17 18:37:58 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/246c31ccf6
@@ -41,6 +41,14 @@ void HTMLInputElement::did_click_button(Badge<Layout::ButtonBox>)
|
||||
}
|
||||
}
|
||||
|
||||
void HTMLInputElement::did_click_checkbox(Badge<Layout::CheckBox>)
|
||||
{
|
||||
// FIXME: This should be a PointerEvent.
|
||||
auto click_event = DOM::Event::create(EventNames::click);
|
||||
click_event->set_bubbles(true);
|
||||
dispatch_event(move(click_event));
|
||||
}
|
||||
|
||||
RefPtr<Layout::Node> HTMLInputElement::create_layout_node(NonnullRefPtr<CSS::StyleProperties> style)
|
||||
{
|
||||
if (type() == "hidden")
|
||||
|
||||
Reference in New Issue
Block a user