I have a pretty simple layout with three TextFields in a Column, the first two set up with
ImeAction.Next
. Should tapping the IME action just do the right thing and focus the next field, or do I need to set this up manually with FocusRequester and KeyboardActions?
➕ 2
tad
06/23/2021, 12:11 AM
Also I thought this worked before, but it doesn't seem to be working automatically on beta09.
m
Michal Klimczak
06/23/2021, 6:07 AM
I don't think it works automatically in compose (yet?)
l
lhwdev
06/23/2021, 6:07 AM
It seems that
ImeAction.Next
is not handled automatically; I struggled with the same problem.
Copy code
// If no custom focus traversal order is specified, perform a search for the appropriate item
// to move focus to.
val nextNode = when (focusDirection) {
Next, Previous -> null // TODO(b/170155659): Perform one dimensional focus search.
Left, Right, Up, Down -> twoDimensionalFocusSearch(focusDirection)
You need to set these things manually with
focusOrder
.
However If you use
Down
and etc, you only need to implement
keyboardActions
.
m
Max Otuteye
06/23/2021, 12:22 PM
I've tried using IME actions, didn't work, so I created focusRequesters and set Key events to trigger the necessary focus request. (Compose Desktop)