Skip to content

Commit

Permalink
Check that scrollViewRef is still available before trying to scroll (#…
Browse files Browse the repository at this point in the history
…17899)

* Check that scrollViewRef is still available before trying to scroll

* Make ESLint happy
  • Loading branch information
koke authored Oct 11, 2019
1 parent 94057a3 commit e5a00cf
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ export const KeyboardAwareFlatList = ( {
this.latestContentOffsetY !== undefined &&
! shouldPreventAutomaticScroll() ) {
// Reset the content position if keyboard is still closed
this.scrollViewRef.props.scrollToPosition( 0, this.latestContentOffsetY, true );
if ( this.scrollViewRef ) {
this.scrollViewRef.props.scrollToPosition( 0, this.latestContentOffsetY, true );
}
}
}, 50 );
} }
Expand Down

0 comments on commit e5a00cf

Please sign in to comment.