<div class='type'>Compose Modifier</div>

<a id='references'></a>


<h2 id="onfocuschanged-onfocuschanged">onFocusChanged</h2>

<div class='sourceset sourceset-common'>Common</div>


```kotlin
fun Modifier.onFocusChanged(onFocusChanged: (FocusState) -> Unit): Modifier
```


Add this modifier to a component to observe focus state events. `onFocusChanged` is invoked when
the focus state changes. The `onFocusChanged` modifier listens to the state of the first
`focusTarget` following this modifier.


Note: If you want to be notified every time the internal focus state is written to (even if it
hasn't changed), use `onFocusEvent` instead.