.MouseLeave event firing after .MouseEnter on adjacent buttons..?

To begin, I’ve got two buttons placed next to each other, the ‘X’ and ‘>’ icons. One is above, and one is below.
image

When you hover over one of said buttons, a ‘.MouseEnter’ event fires, causing a hint to be made visible.
image
In contrast, a ‘.MouseLeave’ event fires when you take your mouse off the button, setting the visibility of the hint to false.

Both buttons have these events tied to them. Both of them use the same label for the hint.
image

Typical stuff, right? However, when I hover from one button directly to the other, the hint just disappears.
image

This is because, for whatever reason, the ‘.MouseLeave’ event of the first button you hover over fires after the ‘.MouseEnter’ event of the second button. The ‘.MouseEnter’ event of the second button does fire and make the hint visible, but it is immediately overwritten by the ‘.MouseLeave’ of the first button making the hint invisible. See my problem? I have absolutely no idea why this is happening, nor have I ever experienced this behavior before. It doesn’t seem to say anything about it on the wiki for either event.

This is either a case of me simply being an idiot and not being in a situation that exposed this behavior before, or this could be some form of bug on part of the engine itself.

Any ideas as to how to fix this or general help would be greatly appreciated.

It also seems that @Shedletsky had a similar problem back in 2016, however it was seemingly ‘fixed’.

This is the only other post I can find on this issue.

I also realize that there are fixes involving yields for this, but that seems more like rough patchwork than anything.

I have this issue as well. There is a ‘solution’ here but I found is that it doesn’t take visibility or order into account so it will trigger even if the button isn’t visible or hidden behind something else. Fed up with MouseEnter and MouseLeave not working? Here's a module for you!

1 Like

Thanks! However, I ended up making my own janky solution involving simply checking if the other button was being hovered over in the ‘.MouseLeave’ event and not hiding it if it was.

1 Like

I’m suggesting you to try to use them in 2 scripts instead of 1 maybe it’ll work