Currently we are looking to create a drag drop centric UI utilizing Common UI as our UI base. We have found that the Common Button Base does not allow for drag and drop functionality with out additional wrappers and handling in other UserWidgets. This means that we have to inject a lot of the functionality from the wrapping User Widget into the button itself.
I have looked through all of the SCommonButton, UCommonButtonBase, and UCommonButtonBaseInternal classes and found that non of these really support any drag drop behaviors and they are not setup to bubble that kind of input up to any other layer.
The only way forward that I have found (without modifying the source) is to completely remake the SCommonButton and following classes with some logic to allow for drag drop to take place. This would also create a cascading situation of rebuilding Common List, and Tile Views to allow us to work with drag drop technology.
Is there a better way to achieve this? Are we missing something that was seen during development of Common UI to cause drag drop to not be supported?
Hi there,
We added support for Drag and Drop to Common Button and List Views with Unreal 5.7
If you’re unable to upgrade, you can try cherry picking the change. The main change is CL 42886976 in Perforce (or this commit on GitHub)
Hello, we have pulled in that change, but I have noticed that there are no hovered events happening while dragging an object. Is this intended? How might we be able to get around this?
I noticed that there is a capture mouse call which probably ends up forwarding all mouse events to the same widget (probably including hover events). Could this be a lead in the right direction?
Yeah it’s intentional that there are no hover events while dragging, it is due to mouse capture.
Depending on what you’re trying to achieve, OnDragOver is how a widget can react to to being hovered during a drag.
Ah, I see. So we would need to basically “fake” what the style system does then for on hover to work for the On Drag. It would be great to have an option to enable this kind of behavior for the OnDragOver events. I feel like this kind of negates the whole point of styles in Common UI a bit as there’s no way to integrate that with drag drop without modifying the code (I did this already for other reasons, such as extending the styles to have more options).
Thanks for your time! I think this is solved at this point. If I have further issues or questions, Ill open a new ticket.