Button Click fails when Button triggers Press → Release → MouseEnter in the same frame

Description

In Unreal Engine’s Slate/UMG system, OnMouseEnter depends on the difference between the previous frame’s widget path and the current frame’s widget path.

When a Button is replaced under the cursor within the same frame, OnMouseEnter can fail, causing OnClick or OnPressed on the new Button to not trigger.

Steps to Reproduce

  1. Create Button A and Button B at the same screen location (B initially hidden).

  2. Set Button A’s OnClicked to make Button B visible and/or replace Button A.

  3. Quickly click Button A.

  4. Observe that Button B sometimes fails to trigger OnMouseEnter or OnClick, even though the cursor is over it.

Expected Result

Button B should correctly trigger OnMouseEnter and OnClick when shown under the cursor.

Actual Result

OnMouseEnter is skipped, causing Button B’s click/hover events to fail.

Notes

  • The issue occurs because Button B is shown under the cursor and, within the same frame, receives Press, Release, and MouseEnter events.

  • OnMouseEnter relies on the previous frame’s widget path for diffing; since Press and Release happen in the same frame, the hover path is updated before MouseEnter is processed.

  • As a result, MouseEnter is skipped, causing Button B’s hover/click events to fail.