<div class='type'>Function</div>


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


<h2 id="scrollbyoffset-action-offset">scrollByOffset</h2>

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


```kotlin
fun SemanticsPropertyReceiver.scrollByOffset(action: suspend (offset: Offset) -> Offset)
```


Action to scroll by a specified amount and return how much of the offset was actually consumed.
E.g. if the node can't scroll at all in the given direction, `Offset.Zero` should be returned.
The action should not return until the scroll operation has finished.

Expected to be used in conjunction with `verticalScrollAxisRange`/`horizontalScrollAxisRange`.

Unlike `scrollBy`, this action is synchronous, and returns the amount of scroll consumed.

#### Parameters

| | |
| --- | --- |
| action | Action to be performed when `SemanticsActions.ScrollByOffset` is called. |