Inconsistent Image Button Pressed Behavior

Image Buttons have a “PressedImage” Property which sets the image of the button once it’s pressed, When you press and hold the button then move our mouse out of the button it “Unpresses” (Returns to the normal button image). Now all of this makes sense and all is good, BUT

For UI, the MouseButton1Up doesn’t get fired if you do the same thing (Press and hold + move the mouse out) creating an inconsistency between the two.

I discovered this when giving the Text inside my image button 2-pixel padding when the button pressed and noticed (by accident) that this happens…

The MouseButton1Up does NOT fire when I release my mouse outside of the button either…

2 Likes

Not a bug – After you drag outside of the GuiButton, why should the GuiButton register the
MouseButton1Up? (If it did, then it would be the same as a button-click, which it is not–Even outside
of Roblox, when you drag out of a button and release outside of the button, it does not constitute a button
click, but it will if you re-enter the button and release.) What you really want is not just the mouse button,
but when the GuiButton visually unpresses. If you want to continue using your padding feature, you’ll
need to Connect to MouseLeave as a way to accomplish the visual GuiButton release detection.

3 Likes