How can I move focus from one group of focus targe...
# compose
a
How can I move focus from one group of focus targets (say buttons) to the next? Code in 🧵
I tried a bunch of stuff, such as handling using
focusManager.move(Next)
on Key Event of the Column, or the Buttons and doesnt seem to be doing the trick. The goal is to be able to jump from one GroupOfButtons to the next when pressing Tab on any of the buttons of the group (instead of having to go through the entire column) The structure is this:
Copy code
@Composable
    fun GroupOfButtons(modifier: Modifier = Modifier) {
        Column(
            modifier = modifier.focusGroup()
        ) {
            repeat(3) {
                Button(onClick = { }) {
                    Text("1")
                }
            }
        }
    }

    Row {
        val leftRequester = remember { FocusRequester() }
        val rightRequester = remember { FocusRequester() }

        GroupOfButtons(
            Modifier
                .focusProperties {
                    next = rightRequester
                }
                .focusRequester(leftRequester)
        )
        GroupOfButtons(
            Modifier
                .focusProperties {
                    previous = leftRequester
                }
                .focusRequester(rightRequester)
        )
    }