Download

How to cancell DragDropOperation after leaving the parent widget?

I have UI panel with some draggable slots:
1.PNG.jpg
And I want to make Drag & Drop operation of slots (from UI to the scene). I’ve already have way to trace the mouse position of Actor which I want to spawn but I don’t know how to convert draggable widget to the Actor without released Left Mouse Button. I want to be able to drag Actor in the scene.

My main idea was to handle OnDragLeave Event in the parent widget and cancell DragDropOperation:
2.PNG

After that I wanted to Spawn new Actor by mouse coordinates. And all this with pressed LMB. But engine crashed with the next error:



...
[2020.01.20-15.52.39:143][386]LogStats: FPlatformStackWalk::StackWalkAndDump -  0.030 s
[2020.01.20-15.52.39:143][386]LogOutputDevice: Error: === Handled ensure: ===
[2020.01.20-15.52.39:143][386]LogOutputDevice: Error: 
[2020.01.20-15.52.39:143][386]LogOutputDevice: Error: Ensure condition failed: Lhs.Array.Num() == Lhs.InitialNum [File:D:\Build\++UE4\Sync\Engine\Source\Runtime\Core\Public\Containers/SparseArray.h] [Line: 904]
[2020.01.20-15.52.39:143][386]LogOutputDevice: Error: Container has changed during ranged-for iteration!
[2020.01.20-15.52.39:143][386]LogOutputDevice: Error: Stack: 
[2020.01.20-15.52.39:143][386]LogOutputDevice: Error: [Callstack] 0x00007ffa5c81b199 UE4Editor-Slate.dll!UnknownFunction ]
[2020.01.20-15.52.39:143][386]LogOutputDevice: Error: [Callstack] 0x00007ffa5c508241 UE4Editor-Slate.dll!UnknownFunction ]
...


I tried to handle OnDragLeave Event in the entries, but I have the same crash report. I think one of two things here, either it’s a bug, or I’m doing something wrong. Maybe someone has had already such case or just knows simpler solution. I’ll be glad to get any help.