diff --git a/libs/simple-button.lua b/libs/simple-button.lua index 154f1a0..94b4b37 100644 --- a/libs/simple-button.lua +++ b/libs/simple-button.lua @@ -265,7 +265,16 @@ end ---@param x number # Mouse position ---@param y number # Mouse position function BUTTON.checkHovering(list, x, y) - for _, v in pairs(list) do v._hovering = v:isHovering(x, y) end + local highlighted_a_button = false + for _, v in pairs(list) do + if highlighted_a_button then + v._hovering = false + else + v._hovering = v:isHovering(x, y) + end + + if not highlighted_a_button and v._hovering then highlighted_a_button = true end + end end --- Trigger the press action, only if ``button._hovering == true``