requestFocusOnHierarchyActive

Compose Modifier

Android
public fun Modifier.requestFocusOnHierarchyActive(): Modifier

This Modifier is used in conjunction with hierarchicalFocusGroup and will request focus on the following focusable element when needed (i.e. this needs to be before that element in the Modifier chain). The focusable element is usually a Modifier.rotaryScrollable (or, in some rarer cases a Modifier.focusable or Modifier.focusTarget)

Multiple requestFocusOnHierarchyActive Modifiers shouldn't be siblings, in those cases they need to surround each with a hierarchicalFocusGroup, and at most one of them should have active = true, to inform which requestFocusOnHierarchyActive should get the focus.

NOTE: This shouldn't be used together with FocusRequester.requestFocus calls in LaunchedEffect.