-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RN-iOS: ScrollView holds onto current offset on rotation #13566
Labels
Comments
I have the same issue, but when the ScrollView is vertical scrolling I have modified @kpink224's code to demonstrate the issue when vertical scrolling: import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
ScrollView,
View,
} from 'react-native';
export default class ScrollBug extends Component {
render() {
return (
<View style={styles.container}>
<ScrollView >
<View style={styles.item} />
<View style={styles.item} />
<View style={styles.item} />
<View style={styles.item} />
<View style={styles.item} />
<View style={styles.item} />
<View style={styles.item} />
<View style={styles.item} />
<View style={styles.item} />
<View style={styles.item} />
<View style={styles.item} />
<View style={styles.item} />
<View style={styles.item} />
<View style={styles.item} />
<View style={styles.item} />
<View style={styles.item} />
</ScrollView>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flexGrow: 1,
},
item: {
height: 100,
backgroundColor: 'red',
borderColor: 'blue',
borderWidth: 10,
},
});
AppRegistry.registerComponent('ScrollBug', () => ScrollBug); |
facebook-github-bot
pushed a commit
that referenced
this issue
Jul 18, 2017
Summary: Previous `contentOffset` can be invalid for a new layout and overscroll the ScrollView, so the diff fixes that. Also documented here: #13566 Reviewed By: mmmulani Differential Revision: D5414442 fbshipit-source-id: 7de1b4a4571108a37d1795e80f165bca5aba5fef
@shergin fixed it! |
This was referenced Aug 12, 2017
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
ScrollView holds onto current offset on rotation causing the content to not scroll to end if needed.
Steps to Reproduce
Result
The content in the scroll view doesn't format to the end of the scrollview
Expected Behavior
The content should be scrolled to the end of the scroll view.
Image
CODE
Additional Information
The text was updated successfully, but these errors were encountered: