invoke iPointerUpHandler without invoking iPointerDownHandler

I have an image with my monobehavior

public class OnUp : MonoBehaviour, IPointerDownHandler, IPointerUpHandler{

    public void OnPointerDown(PointerEventData p) { }


    public void OnPointerUp(PointerEventData p) {

        Debug.Log(p.hovered[0]);
    }
}

Trying to make it call OnPointerUp.
The trick is:

  1. I click aside from my gameObject,

  2. then drag cursor into this image

  3. and release the mouse while over this image.

The OnPointerUp doesn’t fire. That’s because it didn’t receive OnPointerDown() (I clicked to the side of it), is there a way to bypass it?

It’s an old post, but in case anyone still looking for an answer. The OnPointerUp(PointerEventData eventData) is called if the eventData.pointerPress is set to the same object. So, you need to somehow set that value to the object that wanna receive PointerUp event. One way would be:

public class CustomButton : MonoBehaviour, IPointerEnterHandler, IPointerUpHandler
{
    public void OnPointerEnter(PointerEventData eventData)
    {
        eventData.pointerPress = eventData.pointerEnter;
    }

    public void OnPointerUp(PointerEventData eventData)
    {
        print("up event");
    }
}