onFocusChanged

fun Modifier.onFocusChanged(hoverable: Boolean = true, focusable: Boolean = true, interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }, onChanged: (Boolean) -> Unit): Modifier(source)

Extension function to get notified if the Composable is focused.

Return

the Modifier which contains the changes of focus indication.

Parameters

hoverable

whether hovering is enabled and an indicator for focus.

focusable

whether focusing is enabled

interactionSource

the used MutableInteractionSource to indicate if a Composable is focused.

onChanged

called when the focus state changes