Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: StridingDragon on February 08, 2013, 02:09:18 AM
-
Sadly UIInput does not generate an OnSubmit() event when it loses focus because the user clicked on a different button, even though it is technically equivalent to accepting the input. Is there some other event that I could use to capture this happening, so that the contents of the text field can be properly checked, manipulated and copied to wherever they need to go?
-
Leaving the field does not mean submitting it. Hitting Enter is submitting it. If you want it to submit on lost focus, write a script that has OnSelect (bool selected) in it, and react to it.
-
I thought I tried that and never once received an OnSelect event, but I'll try again. Thanks for the tip.
-
Thanks a bunch, Aren. I got it to work with OnSelect, just as you suggested.
-
By the way, I just wanted to let you know that I disagree with your assessment that leaving a field is not the same as submitting. In my view - and I am sure in the view of most people, it most definitely is the same thing.
-
Almost two years later, I encountered the same issue. I have to agree with StridingDragon - losing focus should be considered submitting the text. After all, that's how every text box in the Unity editor works, for validation purposes.