Clicking on widget triggers it's On Mouse Leave Event

I have a overlay with a border along the bottom of it. I use Event on Mouse Enter and Leave to keep track of the cursor being scrolled over a visible widget or not. This works great except when I click on a part of the hid that does not take input (like a border) This triggers the Leave event while the mouse button is down. This does not happen when I click other buttons though.

What’s causing this and is there a way to fix it?

211656-eventleave.gif

Well, I ended up throwing a handled check in the widget’s On Mouse Down event as a catch all to prevent the widget from ignoring all input and it seemed to correct the issue.

Hey!
What do you mean by “handled check”? I face the same issue and no apparent solutions really drive me crazy.

just override the event and return handled like so:

280655-handled.jpg

2 Likes

How are you having OnMouseLeave inside a function? When I override mine in places it in the default event graph where I can’t have anything return. It does not let me copy past the event into a function either (one or more nodes could not be copied)

Thanks! I have the exact same issue and your fix works. Unreal should really fix this issue though.

The same problem can’t be solved by other people’s solutions

It might be too late to reply but if you drag out of mouse event and add is mouse button down, and set the mouse button to left mouse button, and connect to a branch node will solve the problem

3 Likes

Never is late. Thanks for your help, you save me.

For anyone who needs it.
I needed to disable click through on my UI. Used this on my base widget and its stopping any mouse events from triggering “on mouse leave”

2 Likes

This absolutely worked! Ty so much!

The problem is, when I click inside widget, then move mouse out and then release a button, OnMouseLeave event is not triggered and my mouse input remains blocked