Travis Griggs
05/02/2024, 5:08 PMmodifier.onFocusChanged { state ->
if (state.isFocused) {
textState.setTextAndSelectAll(textState.text.toString())
}}
but that has no avail. Is there something I should do differently to do this? (I have the same issue with just normal BasicTextField)Zach Klippenstein (he/him) [MOD]
05/02/2024, 6:26 PMedit
method.
state.edit { selectAll() }
A top-level selectAll
on TFS seems like a reasonable addition to me though. I filed a feature request since we can no longer do this until 1.8Halil Ozercan
05/02/2024, 6:30 PMrequestFocus
call, including your listener. The problem is that after the listeners finish executing, Btf2 continues processing the tap event. This includes changing the selection to a cursor where the tap happened. So if you call selectAll in a focus listener, it immediately gets overridden by Btf2.
I believe this is something we can fix by requesting focus after setting the selection.Travis Griggs
05/02/2024, 6:42 PMif (state.isFocused) {
scope.launch {
textState.edit { selectAll() }
}
}
(aside, @Zach Klippenstein (he/him) [MOD]’s comments confused me. Until I realized it was I who had gotten confused. I must have seen selectAll() as I was clicking through links on TextFieldBuffer and assumed it was on TextFieldState. I top level would be nice, but having to do the edit wrapper is fine. The issue @Halil Ozercan sounds like the real issue for now.Halil Ozercan
05/02/2024, 6:45 PMTravis Griggs
05/02/2024, 6:47 PMTravis Griggs
05/02/2024, 6:59 PMinputTransformation
?Zach Klippenstein (he/him) [MOD]
05/02/2024, 7:00 PM