Search Unity

TextMesh Pro Custom TMP_InputValidator not working.

Discussion in 'UGUI & TextMesh Pro' started by Eklofakka, Jan 22, 2018.

  1. Eklofakka

    Eklofakka

    Joined:
    Nov 4, 2016
    Posts:
    8
    Specs:
    • Unity 2017.3.0f3
    • TextMeshPro 1.0.56.0b2
    • Windows 10 64

    I'm having trouble implementing a validator for my TMP_InputField as shown in the image below. For testing purposes, I've made it really simple. It just returns whatever was typed.

    The problem is that nothing is being printed to the InputField.
    "Are we getting here?" is triggered, so the override is clearly happening.
    • I'm having the same problem in fresh projects.
    • New install of TMP does not fix it.
    • All the default validators provided with TMP in the 'Content Type -> Character Validation' are working.

    Have I implemented this incorrectly?

    Image with relevant info.


    *EDIT*
    I did get it to work using a different approach mentioned here by Jasper Flick. Still curious as to why my approach doesn't work though.
     
    Last edited: Jan 22, 2018