InputField seems to only have OnValueChanged and OnEndEdit as events. I want something like OnBeginEdit or OnFocus to trigger when a user clicks on the InputField in order to clear the Placeholder text. I can simply use a script’s Update method to constantly check for this, but I want it to be triggered rather than unnecessarily loop for a check.
Does anyone know how I would go about doing this? Thanks!
public class ClearPlaceholderOnFocus : MonoBehaviour, ISelectHandler {
public Text placeholderText;
public void OnSelect(BaseEventData data) {
placeholderText.text = "";
}
}
Add this script to the InputField, and it will hide the placeholder when you click on it