Skip to content
This repository has been archived by the owner on Jul 27, 2021. It is now read-only.

Commit

Permalink
fix: chat now gets focused when pressing enter #469
Browse files Browse the repository at this point in the history
  • Loading branch information
AjimenezDCL authored Jun 18, 2019
1 parent 086e09e commit c77c276
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,17 @@ void OnSelect(string str)
OnPointerDown(pointerEventData);
}

//Workaround to focus the chat when pressing enter. This should be deleted once the chat scene gets refactored
private void Update()
{
if (Input.GetKeyDown(KeyCode.Return))
{
if (owner != null && owner.scene != null && owner.scene.isPersistent && !inputField.isFocused)
{
inputField.Select();
FindObjectOfType<MouseCatcher>().UnlockCursor();
}
}
}
}
}

0 comments on commit c77c276

Please sign in to comment.