React-native: Android refresh control scroll behavior interrupts horizontal scroll view

Created on 22 Jun 2016  路  8Comments  路  Source: facebook/react-native

On 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鈥檛 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.

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);
Locked

Most helpful comment

Bringing this up again after encountering the problem. Current version used is RN 0.39. Thanks!

All 8 comments

Definite +1, this will even occur when setting scrollEnabled: false on the Scroll/ListView. RefreshControl definitely shouldn't activate if you can't even scroll vertically in the first place.
cc @janicduplessis

+1

I got the same problem, hope for help!

Also I, 馃幈

+1 here

Bringing this up again after encountering the problem. Current version used is RN 0.39. Thanks!

Hi there! This issue is being closed because it has been inactive for a while. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. Either way, we're automatically closing issues after a period of inactivity. Please do not take it personally!

If you think this issue should definitely remain open, please let us know. The following information is helpful when it comes to determining if the issue should be re-opened:

  • Does the issue still reproduce on the latest release candidate? Post a comment with the version you tested.
  • If so, is there any information missing from the bug report? Post a comment with all the information required by the issue template.
  • Is there a pull request that addresses this issue? Post a comment with the PR number so we can follow up.

If you would like to work on a patch to fix the issue, contributions are very welcome! Read through the contribution guide, and feel free to hop into #react-native if you need help planning your contribution.

@calebmer did you come up with a workaround for this?

Was this page helpful?
0 / 5 - 0 ratings