-
Notifications
You must be signed in to change notification settings - Fork 24.9k
Closed
Closed
Copy link
Labels
BugComponent: FlatListNeeds: ReproThis issue could be improved with a clear list of steps to reproduce the issue.This issue could be improved with a clear list of steps to reproduce the issue.Platform: AndroidAndroid applications.Android applications.Resolution: PR SubmittedA pull request with a fix has been provided.A pull request with a fix has been provided.
Description
- Review the documentation: https://facebook.github.io/react-native
- Search for existing issues: https://github.com/facebook/react-native/issues
- Use the latest React Native release: https://github.com/facebook/react-native/releases
Environment
React Native Environment Info:
System:
OS: macOS High Sierra 10.13.6
CPU: x64 Intel(R) Core(TM) i5-5675R CPU @ 3.10GHz
Memory: 60.77 MB / 8.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 8.11.1 - /usr/local/bin/node
Yarn: 1.9.4 - /usr/local/bin/yarn
npm: 5.6.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.0, macOS 10.14, tvOS 12.0, watchOS 5.0
IDEs:
Android Studio: 3.0 AI-171.4443003
Xcode: 10.0/10A255 - /usr/bin/xcodebuild
npmPackages:
react: 16.5.0 => 16.5.0
react-native: 0.57.2 => 0.57.2
Description
onMomentumScrollEnd doesn't trigger when use scrollToOffset
in Android.
And in iOS it works.
also i find that other methods e.g. scrollToIndex, have the same issue.
Reproducible Demo
export default class App extends Component<Props> {
renderItem = ({item: { source }}) => {
return (
<TouchableOpacity onPress={() => {this.scrollView.scrollToOffset({offset: 375, animated: true})}}>
<Image
source={{uri: source.uri}}
style={{width: 375, height: 375}}
/>
</TouchableOpacity>
)
}
onMomentumScrollEnd = () => {
console.log('scrollend')
}
render() {
return (
<FlatList
style={{ flex: 1, backgroundColor: 'black' }}
data={[
{ source: { uri: 'http://i.imgur.com/XP2BE7q.jpg' } },
{ source: { uri: 'http://i.imgur.com/5nltiUd.jpg' } },
{ source: { uri: 'http://i.imgur.com/6vOahbP.jpg' } },
{ source: { uri: 'http://i.imgur.com/kj5VXtG.jpg' } }
]}
renderItem={this.renderItem}
ref={view => this.scrollView = view}
onMomentumScrollEnd={this.onMomentumScrollEnd}
scrollEnabled={true}
horizontal={true}
/>
);
}
}
otusweb, TusharKoul, csath, mkdotcom, kkoudev and 41 more
Metadata
Metadata
Assignees
Labels
BugComponent: FlatListNeeds: ReproThis issue could be improved with a clear list of steps to reproduce the issue.This issue could be improved with a clear list of steps to reproduce the issue.Platform: AndroidAndroid applications.Android applications.Resolution: PR SubmittedA pull request with a fix has been provided.A pull request with a fix has been provided.