UMG button doesn't release when dragging and dropping

Up and down works fine on buttons but when i click and drag and create a widget to drag the button i first clicked on stays down, until i click on another button or hover over the first one. Better explanation in this video. - YouTube

Without examples, it’s hard to see what you’ve done/where it’s gone wrong.

Perhaps looking at how Wes Bunn handled drag and drop could help: Drag & Drop with UMG | 01 | Live Training | Unreal Engine - YouTube

Started to come back to working on this, I haven’t found an answer for this and it’s bothered me since about September last year, does anyone have any info?

I can see this being a nightmare. I made an inventory system which allows drag and drop, I was getting some unforeseen things happening like if I started a drag, and dropped it in it’s own slot, it would duplicate. You’re dragging it to a different slot, releasing and it’s duplicating. When it’s released it should do everything right there and then, but for some reason you have to move off the released slot and then back on for it to NOT duplicate?

Could it be you need to refresh the inventory display? Maybe the game does indeed remove the other icon on released, but it needs to be refreshed.

For me, my inventories are arrays of inventory item structures. So if I drag from one slot to another and release, I need to add the dragged items to the new inventory and subtract from the old, removing array indexes if the have no quantity left. Everytime I add/subtract inventories I need to refresh the widget, which then re-evaluates the inventories and displays the correct items.

Not sure how you are storing the information that is represented in each inventory slot.

My bad, you’re experiencing duplication because when released it thinks you have 2 mouse cursors and drops an item in both places. That’s actually something I’ve not encountered.

But still, we know it works the first time you try, I’d still look into some sort of refresh, either recalc the inventory slots or remove and redraw the whole widget on released.

I faced the same problem, my usage was to change the normal style to red/green on the drag enter, to indicate that i can place the item on the slot…

The issue is everytime i do first a drag-off from my inverntory slot, the button i used remaind in pressed state afterwards (its just visible by the changed padding values).

If i tried to drag a new item to the widget after that, the normal style would be changed to red/green still… but it is not visible because the pressed style is still visible by this issue.

A real fix i didnt find so far, maybe there is an option to reset the styles&states on the button, Idk…?
But to issue seams to heal it self, if i just press another button on the parents widget… so another itemslot in my case?!

I guess there is a kind of bug or another special handling is needed on the Drag&Drop, maybe for discading the events?

My workaround for this, is just that i store the default style on creating the slot widget and in my on dragEnter i just overwrite all styles (normal/hover/pressed), like this: