Skip to content

Commit

Permalink
Actually fix `Uncaught TypeError: _this.refs.scrollView.scrollTo is n…
Browse files Browse the repository at this point in the history
…ot a function` when using https://github.com/flyskywhy/react-web
  • Loading branch information
flyskywhy authored Sep 4, 2017
1 parent aca1dbe commit adee859
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ export default class extends Component {
if (state.dir === 'x') x = diff * state.width
if (state.dir === 'y') y = diff * state.height

if (Platform.OS === 'android') {
if (Platform.OS !== 'ios') {
this.scrollView && this.scrollView[animated ? 'setPage' : 'setPageWithoutAnimation'](diff)
} else {
this.scrollView && this.scrollView.scrollTo({ x, y, animated })
Expand All @@ -432,7 +432,7 @@ export default class extends Component {
})

// trigger onScrollEnd manually in android
if (!animated || Platform.OS === 'android') {
if (!animated || Platform.OS !== 'ios') {
setImmediate(() => {
this.onScrollEnd({
nativeEvent: {
Expand Down

0 comments on commit adee859

Please sign in to comment.