In order to quickly edit many form fields you can use the tab key to quickly move from one field to the next. In order to also be able to immediately start typing it would be necessary though that the current content of a text field automatically gets selected as soon as the field gets the focus. Does anybody know how this behaviour could be implemented via compose?
k
kevindmoore
04/24/2023, 2:35 PM
Isn’t that just with the FocusRequester? (at least it is in Android)
m
Michael Paus
04/24/2023, 2:44 PM
How do you mean that? The question is not about getting the focus, it is about selecting the text inside the text field when I get the focus. If you have a simple solution via FocusRequester let me know.
k
kevindmoore
04/24/2023, 2:55 PM
Hmm. I see a Modifier.onFocusChanged that you could listen to focus events and then select the text for the field that has focus?
m
Michael Paus
04/24/2023, 6:46 PM
Thanks. I somehow missed that. That’s indeed simpler than the solution I used before.