Hello!
I’m trying to implement Drag and Drop system in my Inventory, but i’ve encountered a problem - when i override OnPreviewMouseButton event and put “Detect Drag if pressed” node in there, event onClicked stops working - it works only with second click, if i press the button twice, like if Detect Drag consumes the first click.
I’ve tried to use “Precise click” in button settings, but it doesn’t help.
Here’s my widget with button:
How can i make Detect Drag and onClicked work together?
I think this could be to do with the OnPreviewMouseButton overriding the On Clicked
I’m not sure you can directly fix this it might just be how the thing works, and i’m sure the standard OnMouseButtonDown doesn’t work with the drag system as it cant detect left click.
You could try handling your on clicked logic inside the OnPreviewMouseButton
Or
use a event dispatcher, call a function or call an event if you don’t want to handle your logic inside the OnPreviewMouseButton