androidx.compose.foundation

focusGroup

Function · from org.jetbrains.compose.foundation:foundation:1.12.2

No hand-written docs yet.

Creates a focus group or marks this component as a focus group. This means that when we move focus using the keyboard or programmatically using [FocusManager.moveFocus()]androidx.compose.ui.focus.FocusManager.moveFocus, the items within the focus group will be given a higher priority before focus moves to items outside the focus group.

Parameters

fun Modifier.focusGroup(): Modifier
Library docs

Creates a focus group or marks this component as a focus group. This means that when we move focus using the keyboard or programmatically using [FocusManager.moveFocus()]androidx.compose.ui.focus.FocusManager.moveFocus, the items within the focus group will be given a higher priority before focus moves to items outside the focus group.

In the sample below, each column is a focus group, so pressing the tab key will move focus to all the buttons in column 1 before visiting column 2.