Why are InputFields not getting activated?

I don’t understand if it’s a bug in unity or wrong implementation of code but my inputFields are not getting activated when i click on the them. It activated for a fraction of a second and goes back to another inputfield. I have tried using handler in inspector and code as well but it is behaving in the same way.

I think its something to with event listeners that I am enabling using OnEnable(). Please throw some light on this.

What exactly am I doing wrong?

Thanks in advance.
This is my code:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;

public class TabManager : MonoBehaviour
{
    public InputField name1;
    public InputField Date;
    public InputField Month;
    public InputField Year;
    public InputField Phn;



    private void Update()
    {
       
       
    }

    void OnEnable()
    {


        
            name1.onEndEdit.AddListener(delegate { endEdit1(); });




            Date.onValueChanged.AddListener(delegate { valueChanged(); });
            Date.onEndEdit.AddListener(delegate { endEdit2(); });







            Month.onValueChanged.AddListener(delegate { valueChanged2(); });
            Month.onEndEdit.AddListener(delegate { endEdit3(); });





            Year.onValueChanged.AddListener(delegate { valueChanged3(); });
            Year.onEndEdit.AddListener(delegate { endEdit4(); });

        

    }
    //Called when Input is submitted
    private void endEdit1()
    {
        Date.ActivateInputField();
    }
    private void endEdit2()
    {
        Month.ActivateInputField();
    }
    private void endEdit3()
    {
        Year.ActivateInputField();
    }
    private void endEdit4()
    {

        Phn.ActivateInputField();

    }
    private void valueChanged()
    {

        if(Date.text.Length == 2)
        {
            Month.ActivateInputField();
        }

    }
    private void valueChanged2()
    {

        if (Month.text.Length == 2)
        {
            Year.ActivateInputField();
        }

    }
    private void valueChanged3()

    {

        if (Year.text.Length == 4)
        {
            Phn.ActivateInputField();
        }

    }
    void OnDisable()
    {
        
        name1.onEndEdit.RemoveAllListeners();
        Debug.Log("name");

        Date.onEndEdit.RemoveAllListeners();
        Date.onValueChanged.RemoveAllListeners();
        Debug.Log("Date");

        Month.onEndEdit.RemoveAllListeners();
        Month.onValueChanged.RemoveAllListeners();
        Debug.Log("Month");

        Year.onEndEdit.RemoveAllListeners();
        Year.onValueChanged.RemoveAllListeners();
        Debug.Log("Year");
    }


}

I am using Unity 2018.4.9 with VS2017

When you click an input field, you are selecting it, but at the same time you are calling OnEndEdit Listener on another field that was previously selected, which in turn selects another as per your code.