https://kotlinlang.org logo
Title
t

theapache64

03/10/2021, 9:54 PM
How can I move focus to next focusable composable when pressing
Tab
from a
TextField
? Do we have any built-in support? (other than manually moving the focus using a state). I am looking for something like tabIndex
👀 2
1
a

Andrew Rudenko [JB]

03/11/2021, 7:11 AM
Check
Modifier.focusOrder
🆗 1
t

Timo Drick

03/11/2021, 12:37 PM
Also working on focus problems currently but for Jetpack Compose. I found sample code here which works on Google TV. Not sure if it also works for Compose for Desktop: https://cs.android.com/androidx/platform/frameworks/support/+/0a6f6ab5001b4885cf6f47[…]/java/androidx/compose/ui/demos/focus/CustomFocusOrderDemo.kt
t

theapache64

03/14/2021, 1:22 PM
thanks @Timo Drick i'll check thos
a

Andrew Rudenko [JB]

03/14/2021, 1:23 PM
yes, it should work for Compose for Desktop too
👍 1
t

theapache64

03/14/2021, 2:20 PM
focusOrder worked. 👍 but the focus is not going to Button from
TextField
. Is there anything else I need to do?