- Home /
UI.InputField : Highlight, Select, Selection
"Because of reasons"© I need to manage my pointer by script instead of letting Unity manage the pointer. Im working with javascript. 2 problems, 1 question :
Doing Select() on a Button makes it highlighted and doesnt trigger the button action - alright. Doing Select() on an InputField makes it highlighted BUT also triggers the input mode (so your keystrokes are registered into the input field). How can I highlight an InputField WITHOUT triggering the input mode ?Highlighting
I create my InputField at run time, I add a child rectTransform with Text to it, and set both InputField.text and InputField.textComponent.text to the same value ("test"). When I Select() the InputField, the textComponent.text gets cleared ("") and the InputField.text stays the same ("test"). I was expecting both values to stay the same until I actually do some input. Is it a bug or am I doing something wrong ? Note that after creation, the only script affecting the InputField is the .Select() call.InputField.Select() clears the text
Simple question : how to retrieve and change the selection (highlighted text) of an InputField ? For instance what should I do to have the first 3 characters of the inputfield selected ?InputField selected text ?
Thanks in advance.
Take a look at the source code for UI.InputField. That should give you some insight into whether this is possible using the public API (ideal), or possibly by subclassing InputField (not a great idea as internal implementation can and probably will change in the future... but maybe faster than writing your own version), or writing your own InputField using the source as a reference.
Your answer
Follow this Question
Related Questions
Create clickable GameObjects (JS) 1 Answer
I have doubt please help me 2 Answers
Deactivating a power up script after a certain amount of time 1 Answer
Can someone help me fix my Javascript for Flickering Light? 6 Answers
Touch Control Android Java 0 Answers