summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb
diff options
context:
space:
mode:
authorRafał Babiarz <5783815+sauler@users.noreply.github.com>2022-02-08 17:38:16 +0100
committerAndreas Kling <kling@serenityos.org>2022-02-08 17:51:33 +0100
commit3383ae1598434d27c2a185a5498e729f4ce8512c (patch)
treefec977057f1a3fd23afeb0f755f06d1bb1c7e567 /Userland/Libraries/LibWeb
parent103613a3a933a0213c88064f65b1d3e5ab48ec3b (diff)
downloadserenity-3383ae1598434d27c2a185a5498e729f4ce8512c.zip
LibWeb: Fixed disabled checkbox input behaviour
Previously disabled checkbox could be checked by clicking on it's label
Diffstat (limited to 'Userland/Libraries/LibWeb')
-rw-r--r--Userland/Libraries/LibWeb/Layout/CheckBox.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/Layout/CheckBox.cpp b/Userland/Libraries/LibWeb/Layout/CheckBox.cpp
index 71a87f96ef..5d043e0198 100644
--- a/Userland/Libraries/LibWeb/Layout/CheckBox.cpp
+++ b/Userland/Libraries/LibWeb/Layout/CheckBox.cpp
@@ -87,12 +87,18 @@ void CheckBox::handle_mousemove(Badge<EventHandler>, const Gfx::IntPoint& positi
void CheckBox::handle_associated_label_mousedown(Badge<Label>)
{
+ if (!dom_node().enabled())
+ return;
+
m_being_pressed = true;
set_needs_display();
}
void CheckBox::handle_associated_label_mouseup(Badge<Label>)
{
+ if (!dom_node().enabled())
+ return;
+
// NOTE: Changing the checked state of the DOM node may run arbitrary JS, which could disappear this node.
NonnullRefPtr protect = *this;
@@ -102,7 +108,7 @@ void CheckBox::handle_associated_label_mouseup(Badge<Label>)
void CheckBox::handle_associated_label_mousemove(Badge<Label>, bool is_inside_node_or_label)
{
- if (m_being_pressed == is_inside_node_or_label)
+ if (m_being_pressed == is_inside_node_or_label || !dom_node().enabled())
return;
m_being_pressed = is_inside_node_or_label;