I updated the OnEndDrag as below. Added Input.GetTouch(0).fingerId This now works on android but is broken on PC. Would be great if someone has an agnostic solution to this.
void IEndDragHandler.OnEndDrag(PointerEventData eventData)
{
transform.position = startPosition;
GetComponent<CanvasGroup>().blocksRaycasts = true;
transform.SetParent(originalParent, true);
IDragDestination<T> container;
if (!EventSystem.current.IsPointerOverGameObject(Input.GetTouch(0).fingerId))
{
container = parentCanvas.GetComponent<IDragDestination<T>>();
}
else
{
container = GetContainer(eventData);
}
if (container != null)
{
DropItemIntoContainer(container);
}
}