mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:57:45 +00:00
LibWeb: Do not fire click event if mouseup/down elements do not match
Click event logic should start as false, and after checking if the mousedown and subsequent mouseup have been on the same element, and if the node dispatches events it can become true. This fixes the issue that clicking anywhere on the page, then dragging the mouse on top of a link or button, then releasing triggers the link. This is also happening when selecting text, if the selection stops over a link, the page navigates.
This commit is contained in:
parent
065c8cefb8
commit
05dd46f9e3
1 changed files with 1 additions and 1 deletions
|
@ -242,7 +242,7 @@ bool EventHandler::handle_mouseup(CSSPixelPoint position, unsigned button, unsig
|
|||
node->dispatch_event(UIEvents::MouseEvent::create_from_platform_event(node->realm(), UIEvents::EventNames::mouseup, offset, client_offset, page_offset, buttons, button).release_value_but_fixme_should_propagate_errors());
|
||||
handled_event = true;
|
||||
|
||||
bool run_activation_behavior = true;
|
||||
bool run_activation_behavior = false;
|
||||
if (node.ptr() == m_mousedown_target) {
|
||||
if (button == GUI::MouseButton::Primary)
|
||||
run_activation_behavior = node->dispatch_event(UIEvents::MouseEvent::create_from_platform_event(node->realm(), UIEvents::EventNames::click, offset, client_offset, page_offset, button).release_value_but_fixme_should_propagate_errors());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue