diff --git a/src/ftxui/component/checkbox.cpp b/src/ftxui/component/checkbox.cpp index 3d95edb3..ebfa46d8 100644 --- a/src/ftxui/component/checkbox.cpp +++ b/src/ftxui/component/checkbox.cpp @@ -70,25 +70,17 @@ class CheckboxBase : public ComponentBase, public CheckboxOption { } if (event.mouse().button == Mouse::Left && - event.mouse().motion == Mouse::Pressed && - isMousePressed == false) { + event.mouse().motion == Mouse::Pressed) { *checked = !*checked; - isMousePressed = true; on_change(); return true; } - if (event.mouse().button == Mouse::Left && - event.mouse().motion == Mouse::Released) { - isMousePressed = false; - } - return false; } bool Focusable() const final { return true; } - bool isMousePressed = false; bool hovered_ = false; Box box_; };