I have a panel that can be dragged. It contains an Event Trigger, so when I stop dragging, it goes back to the original position (by calling a function in the event Pointer Up). Inside this panel I have a button. When I try to drag the panel by holding the button and moving, it drags ok, but when I release the buttom, the panel doesn't come back to original position. How can I solve this? If the Button component had an "On Cancel" event, it would be nice.
is it possible the event is not triggered because your mouse is on top of the button? As a quick hack i would call the same event on the button.
Yes. This is, however, strange. When I hold the button, the panel's Event Trigger detects the "Pointer Down" event and calls the corresponding function, but when I release the button, it doesn't catch the "Pointer Up" event. I was able to solve by removing the Button component from the button object. Instead I added another Event Trigger on it.