Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

TextMesh Pro TMP_Inputfield OnSubmit behaving as OnEndEdit on mobile(tested on Android only)

Discussion in 'UGUI & TextMesh Pro' started by FernandoHC, Jun 19, 2018.

  1. FernandoHC

    FernandoHC

    Joined:
    Feb 6, 2018
    Posts:
    338
    Hello all,

    As the title says:
    When adding listener to TMP_Inputfield for event OnSubmit, it is being triggered like an OnEndEditon mobile, after the virtual keyboard is closed, it triggers a send. But it behaves correctly when testing in the editor.

    As I understand, OnSubmit should only be called when pressing the return key on virtual mobile keyboard(equivalent to pressing enter).
    However on mobile, losing focus (selecting another object) for the inputfield is calling OnSubmit.

    Not sure if this is a bug, or intended, just hoping for some suggestion on how to work around this, on how to detect if it was actually submitted intentionally, not just closing virtual keyboard.

    Cheers.
    Thanks in advance
     
    Last edited: Jul 31, 2018
  2. FernandoHC

    FernandoHC

    Joined:
    Feb 6, 2018
    Posts:
    338
    Bumping, as issue still happens.
     
  3. Devilwhale

    Devilwhale

    Joined:
    Jul 29, 2015
    Posts:
    4
    What I have done, is check my local value to the input value, and only process the send event if they do not match.
    if (local != tmp_input.text) { do stuff }, so misfires don't trigger it.

    However, it doesn't solve the issue of not having a proper OnSubmit.

    Is there a better way?
     
    ImperativeGames likes this.
  4. stenfeio

    stenfeio

    Joined:
    Jan 18, 2015
    Posts:
    22
    Can confirm this still happens in 2020.3.29f1.