feathersui-starling icon indicating copy to clipboard operation
feathersui-starling copied to clipboard

TextInput.setFocus() and selectRange()

Open mshaffer12882 opened this issue 6 years ago • 0 comments

setFocus calls selectRange(0, this._text.length), which selects all the text. This causes a problem on iOS especially when multiline = false because of the AIR bug. The TextInput will select all the text very quickly and then change if you call selectRange() right after setFocus(). However, if you place the cursor at the end of the text and then call selectRange it gives it a much cleaner look in my option.

Maybe a having an argument to set the range so you don't have to call selectRange? or change it to this.selectRange(this._text.length, -1); so it places the cursor at the end of the text instead of selecting all the text?

What do you think?

mshaffer12882 avatar Jun 18 '18 06:06 mshaffer12882