How to disable the input for the ThirdPersonController/normal input when the player is writing in an InputField?

Is it possible to disable the input for the ThirdPersonController/normal input when the player is typing in an InputField? Or will I have to manually set up flags to disable/enable the input handling in the controller when the player clicks on the InputField using the OnSelect event for the box?

bool inputEnabled;

void Update()
{
  if (inputEnabled)
  {
    //accept input
  }
}