FocusManager

Interface

Common
@JvmDefaultWithCompatibility
interface FocusManager

Functions

fun clearFocus(force: Boolean = false)

Call this function to clear focus from the currently focused component, and set the focus to the root focus modifier.

Parameters

force:Whether we should forcefully clear focus regardless of whether we have any components that have Captured focus.
fun moveFocus(focusDirection: FocusDirection): Boolean

Moves focus in the specified direction.

If you are not satisfied with the default focus order, consider setting a custom order using Modifier.focusProperties().

Returns

true if focus was moved successfully. false if the focused item is unchanged.