Unity UI does not visible when i drag using canvas set to screen space - camera

when i set canvas to screen space overlay, the UI is visible during dragging, but when i set the canvas to screen space camera it is not visible while dragging, and i just need drag in screen space camera. Here is my drag code:

using UnityEngine;
using System.Collections;
using UnityEngine.EventSystems;

public class Drag : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHandler {
	
	public Transform parentToReturnTo=null;
	public void OnBeginDrag(PointerEventData eventData){
		Debug.Log ("OnBeginDrag");

		parentToReturnTo = this.transform.parent;
		this.transform.SetParent (this.transform.parent.parent);
		GetComponent<CanvasGroup> ().blocksRaycasts = false;
	}

	public void OnDrag(PointerEventData eventData){
		Debug.Log ("OnDrag");
		this.transform.position = eventData.position;
	}

	public void OnEndDrag(PointerEventData eventData){
		Debug.Log ("OnEndDrag");
		this.transform.SetParent(parentToReturnTo);
		GetComponent<CanvasGroup> ().blocksRaycasts = true;
	}
}

//if canvas screen space = camera

public void OnDrag(PointerEventData eventData){

		Vector3 screenPoint = Input.mousePosition;
		screenPoint.z = 100.0f; //distance of the plane from the camera
		transform.position = Camera.main.ScreenToWorldPoint(screenPoint);
}