Skip to content
This repository has been archived by the owner on Nov 27, 2022. It is now read-only.

Commit

Permalink
fix: setting initial tab behaviour for iOS RN 0.59.x (#762)
Browse files Browse the repository at this point in the history
Fix an issue where the initial tab is ignored on iOS and React Native 0.59.x when the initial tab is not the first tab in the set.

This uses the newly introduced scrollToOverflowEnabled prop: facebook/react-native@e3ac329

It seems counterintuitive to have this along with `overScrollMode="never"` but overScrollMode really controls the ability to scroll past the ends of a ScrollView, while scrollToOverflowEnabled allows us to manually `scrollTo()` an arbitary position out of bounds of the ScrollView.

I'm unusual of the underlying change in RN0.59.x that caused this, but it seems that the ScrollView hasn't completed layout when the `_setInitialPage()` is called, so it's unable to scroll to a non-zero x value.
  • Loading branch information
levibuzolic authored and osdnk committed May 2, 2019
1 parent 557e9e5 commit a1c00b0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/PagerScroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ export default class PagerScroll<T: *> extends React.Component<
keyboardDismissMode="on-drag"
keyboardShouldPersistTaps="always"
overScrollMode="never"
scrollToOverflowEnabled
scrollEnabled={this.props.swipeEnabled}
automaticallyAdjustContentInsets={false}
bounces={false}
Expand Down

0 comments on commit a1c00b0

Please sign in to comment.