1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 05:15:07 +00:00

LibWeb: Dispatch "mouseup" event

This is a very naive implementation that doesn't account for where the
mousedown happened.
This commit is contained in:
Andreas Kling 2020-03-21 17:55:41 +01:00
parent 8b18674229
commit b196665131

View file

@ -248,6 +248,12 @@ void HtmlView::mouseup_event(GUI::MouseEvent& event)
if (!layout_root())
return GUI::ScrollableWidget::mouseup_event(event);
auto result = layout_root()->hit_test(to_content_position(event.position()));
if (result.layout_node) {
if (auto* node = result.layout_node->node())
const_cast<Node*>(node)->dispatch_event("mouseup");
}
if (event.button() == GUI::MouseButton::Left) {
dump_selection("MouseUp");
m_in_mouse_selection = false;