From 5630dd6b2f90ec36a3e6b0f1d1c0532b36396b4b Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sun, 4 Jun 2017 18:27:36 -0400 Subject: fix scroll on mobile timelinefull --- client/src/lib/timeline/timelineFull.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'client/src') diff --git a/client/src/lib/timeline/timelineFull.js b/client/src/lib/timeline/timelineFull.js index e5d4ff8..7af00a8 100644 --- a/client/src/lib/timeline/timelineFull.js +++ b/client/src/lib/timeline/timelineFull.js @@ -106,6 +106,7 @@ export default class TimelineFull extends Component { contentContainerStyle={isMobile ? mobileStyles.item : styles.item} horizontal={false} showsHorizontalScrollIndicator={false} + ref={ (ref) => this.scrollView = ref } > {image} {item.title} @@ -132,6 +133,9 @@ export default class TimelineFull extends Component { ) } + componentDidUpdate() { + this.scrollView.scrollTo({ y: 0, x: 0, animated: false }) + } } function linkTextFromUrl (url) { @@ -153,14 +157,14 @@ const mobileStyles = StyleSheet.create({ item: { maxWidth: 400, maxHeight: 250, - padding: 40, - paddingTop: 50, + padding: 20, }, bodyContainer: { width: '100%', }, metadataContainer: { width: '100%', + marginBottom: 50, }, }) -- cgit v1.2.3-70-g09d2