Android refresh control scroll behavior interrupts horizontal scroll view
See original GitHub issueOn Android, when scrolling through horizontal ListView
, if you scroll slightly up as well the RefreshControl
starts to appear. This is undesirable and does not happen in iOS. When scrolling horizontal normally you cannot scroll up and down at the same time, one shouldn’t be able to activate the refresh control when scrolling horizontally.
To reproduce this behavior, start scrolling left/right then move your finger down as in a refresh. The refresh control will come down and interrupt your horizontal scroll.
- Minimum code sample: https://rnplay.org/apps/T7drbA (or pasted below).
- React Native version is
^0.26.0
. - Occurs only on Android.
- Using a Mac.
Code sample:
'use strict';
var React = require('react-native');
var {
AppRegistry,
StyleSheet,
Text,
View,
ListView,
RefreshControl,
ScrollView,
} = React;
var SampleApp = React.createClass({
getInitialState: function() {
return {
dataSource: new ListView.DataSource({ rowHasChanged: (a, b) => a !== b })
}
},
render: function() {
return (
<ListView
dataSource={this.state.dataSource.cloneWithRows([1, 2, 3])}
refreshControl={<RefreshControl refreshing={false}/>}
renderHeader={() => (
<ScrollView horizontal>
<View style={[styles.box, { backgroundColor: 'red' }]}/>
<View style={[styles.box, { backgroundColor: 'green' }]}/>
<View style={[styles.box, { backgroundColor: 'blue' }]}/>
</ScrollView>
)}
renderRow={row => <View><Text>{row}</Text></View>}
/>
);
}
});
var styles = StyleSheet.create({
box: {
width: 200,
height: 200,
}
});
AppRegistry.registerComponent('SampleApp', () => SampleApp);
Issue Analytics
- State:
- Created 7 years ago
- Reactions:10
- Comments:8 (2 by maintainers)
Top Results From Across the Web
HorizontalScrollView - Android Developers
HorizontalScrollView only supports horizontal scrolling. ... Caching behavior of children may be controlled through View#setLayerType(int, Paint) .
Read more >HorizontalScrollView inside ListView: minor vertical scroll ...
The problem is that ListView (or rather its parent AbsListView ) implements onInterceptTouchEvent and hence ListView can intercept all touch ...
Read more >Well-controlled scrolling with CSS Scroll Snap - web.dev
The CSS Scroll Snap feature allows web developers to create well-controlled scroll experiences by declaring scroll snapping positions.
Read more >Titanium.UI.ScrollView
On Android, a scroll view can only scroll in one direction, either vertically or horizontally, and not both at the same time. The...
Read more >Take control of your scroll - customizing pull-to-refresh and ...
Turns out this behavior is called scroll chaining; the browser's default behavior when scrolling content. Oftentimes the default is pretty nice, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Bringing this up again after encountering the problem. Current version used is RN 0.39. Thanks!
@calebmer did you come up with a workaround for this?