Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TextInput.setFocus() and selectRange() #1737

Open
mshaffer12882 opened this issue Jun 18, 2018 · 0 comments
Open

TextInput.setFocus() and selectRange() #1737

mshaffer12882 opened this issue Jun 18, 2018 · 0 comments
Labels

Comments

@mshaffer12882
Copy link

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?

@joshtynjala joshtynjala added this to the 4.0 milestone Jun 21, 2018
@joshtynjala joshtynjala removed this from the 4.0 milestone Nov 15, 2018
@joshtynjala joshtynjala changed the title TextInput.setFocus() TextInput.setFocus() and selectRange() Aug 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants