Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/api/user-event.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,12 @@ The sequence of events depends on whether the scroll includes an optional moment
- `scroll` (multiple events)
- `momentumScrollEnd`

### Final scroll offset

As in native `ScrollView`, the last drag step does not trigger a `scroll` event. A drag-only scroll (no `momentumY` or `momentumX`) delivers the target offset only in `scrollEndDrag`, so `onScroll` never sees it. For example, `scrollTo(scrollView, { y: 100 })` calls `onScroll` with offsets below 100, then calls `onScrollEndDrag` with 100. With momentum, the last `scroll` event and `momentumScrollEnd` both carry the final momentum offset.

This matters when UI depends on the `onScroll` offset, like sticky headers, "scroll to top" buttons, or paging indicators. To have `onScroll` receive the target offset, add a momentum part, e.g. `scrollTo(scrollView, { y: 50, momentumY: 100 })`. If your component needs the resting position, also handle `onScrollEndDrag` and `onMomentumScrollEnd`, as on a real device.

## `pullToRefresh()` \

> [!NOTE]
Expand Down
6 changes: 6 additions & 0 deletions website/docs/14.x/docs/api/events/user-event.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,12 @@ The sequence of events depends on whether the scroll includes an optional moment
- `scroll` (multiple events)
- `momentumScrollEnd`

### Final scroll offset {#scroll-final-offset}

As in native `ScrollView`, the last drag step does not trigger a `scroll` event. A drag-only scroll (no `momentumY` or `momentumX`) delivers the target offset only in `scrollEndDrag`, so `onScroll` never sees it. For example, `scrollTo(scrollView, { y: 100 })` calls `onScroll` with offsets below 100, then calls `onScrollEndDrag` with 100. With momentum, the last `scroll` event and `momentumScrollEnd` both carry the final momentum offset.

This matters when UI depends on the `onScroll` offset, like sticky headers, "scroll to top" buttons, or paging indicators. To have `onScroll` receive the target offset, add a momentum part, e.g. `scrollTo(scrollView, { y: 50, momentumY: 100 })`. If your component needs the resting position, also handle `onScrollEndDrag` and `onMomentumScrollEnd`, as on a real device.

## `pullToRefresh()` \{#pull-to-refresh}

:::note
Expand Down
Loading