Search Issue Tracker
Fixed in 4.6.X
Votes
1
Found in
4.6.0f1
Issue ID
646207
Regression
Yes
No way to set InputField's text by script
To reproduce:
1. Open attached project
2. Open Test scene (The test scene has a single input field. Attached is a script that just sets the field's .text property to "Test Text" at Star)
3. Press play
4. Note that the inputField's placeholder text is cleared, but no text is put in its place. Check the inspector for the InputField. Its "Text" field will have text inside it, even though no text is being displayed in the game.
5. Toggle the "Also Set Text Component" checkbox on the script component attached to the InputField. Now the InputField's .textComponent.text will also be filled at Start
6.Enter play mode. The text will now appear in the InputField as expected. But... if you click on the InputField in game view to edit its value, then the text will be erased. The InputField thinks it's empty, even though it has a text value and its textComponent.text also has a value.
Comments (2)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- NullReferenceException is thrown and UI builder breaks when using a USS class with "transition-property: none"
- Editor crash on "PPtr<Shader>::operator Shader*() const" when checking in changes with a very long comment in Unity Version Control window
- [Ubuntu] Toolbar and menu items for Version Control lack spaces in text on Linux
- Unity Version Control window Pending Changes tab’s Item checkbox is unresponsive when clicked and the item list is empty
- Audio stuttering occurs when heavy processing is performed while OnAudioFilterRead is in use
gmatthews
Feb 24, 2016 12:14
in 5.3.2f1, I get 2 different behaviours.
1. If I have populated a script InputField variable through wiring it up in the Unity UI, then the script is able to set the InputField.text property, and I see this correctly reflected on the screen.
HOWEVER
2. If I create a prefab with an InputField and dynamically Instantiate the prefab then I CANNOT set the InputField.text property.
RollingBell
Aug 11, 2015 12:28
It's not solved in Unity 5.1.2f.