click and drag drop function won't trigger after widget closes

Currently using 5.3.2, I have an inventory system which is set up this way:
I have a background HUD widget with an event on it to open the player menu
the player menu then has an inventory grid widget on it, which in turn has a number of inventory slot widgets, the number of these is determined by a variable in an inventory component that I can attach to any actors that have inventories.

The inventory slots themselves have drag and drop functionality using a drag and drop operation that spawns an icon that’s stuck to the mouse while dragging, and makes that icon go away on drop. The rest of the code is to determine if the slot being dropped on is an empty inventory slot or not, I have the ability to move items between inventory slots and swap items between slots built into this.

For the On Drag Detected I have this code:

for the On Drop I have this code:

however if I’m still clicking and dragging when the inventory is closed and then I let go of the mouse button, the mouse cursor doesn’t go away and the item icon is still there, it’s like the on drop doesn’t occur.
This is the code I use to change between UI and game:


Here’s how I open it (this is on the playerhud event graph):

here’s how I close it (this is on the playermenu blueprint):

I’d like the cursor and the held widget to go away when I close the inventory if possible

so even though I got no answer, I found the solution. I had to add a “cancel drag drop” node after the branch in the onkeydown function.