I am trying to set the cursor position to an specific place into my TextInput, but I don't find the way to do it.
I want to do something similar to the following in Flash TextField
textField.setSelection(4,4); // which set the caret at position 4
Is it doable in Feathers TextInput?
What do I need this for?
I need the people to fill in their Phone number in a TextInput, people can only type Numeric characters (I restricted non numeric characters to be typed).
The prompt tells them to follow this convention
So I want the text into the TextInput to be updated accordingly.
If for example people fill in this phone number: 555 321 9876
I need the text into the TextInput to be shown as this sequence:
(5XX) XXX-XXXX when user has typed: 5
(55X) XXX-XXXX when user has typed: 55
(555) XXX-XXXX when user has typed: 555
(555) 3XX-XXXX when user has typed: 5553
(555) 32X-XXXX when user has typed: 55532
(555) 321-XXXX when user has typed: 555321
(555) 321-9XXX when user has typed: 5553219
(555) 321-98XX when user has typed: 55532198
(555) 321-987X when user has typed: 555321987
(555) 321-9876 when user has typed: 5553219876
Right now, if I type that phone number I get this text: (553) 987-6125
And that happens because I can no update the caret position, so the Number is placed on a undesired position.