mirror of
https://github.com/status-im/react-native.git
synced 2025-01-12 18:44:25 +00:00
9733b92f3d
Summary: This PR exposes the `onScrollToTop` event on iOS using the same event-forwarding infrastructure as other ScrollView events. (As such, its `nativeEvent` object reflects the same fields as other ScrollView events.) Motivation: ---------- If your app is only interested in knowing the position of a ScrollView after a scroll has completed, it can use `onScrollEndDrag` and `onMomentumScrollEnd` to inspect the `contentOffset` after a drag-initiated scroll has finished. (This is much less expensive than observing the `onScroll` event if you only want to know the end position.) However, neither of these `End` events fire if the ScrollView is scrolled to the top by tapping the status bar. By exposing `onScrollToTop`, it is now possible for an app to cheaply know when such a scroll has completed. Pull Request resolved: https://github.com/facebook/react-native/pull/21204 Differential Revision: D9943618 Pulled By: hramos fbshipit-source-id: ac5ee42b7f12d94655ffda617f8f811138da7f6f