react-native: [Android] onResponderMove nativeEvent locationX does not change

Hey guys,

Running into a bug (on Android only) where locationX of onResponderMove never changes as you drag along the view.

var MyComponent = React.createClass({
  onStartShouldSetResponder: function(e) {
    return true;
  },

  onMoveShouldSetResponder: function(e) {
    return true;
  },

  onResponderMove: function(e) {
    var evt = e.nativeEvent;
    console.log(evt.locationX);
  },

  render: function() {
    return (
      <View
        style={styles.box}
        onStartShouldSetResponder={this.onStartShouldSetResponder}
        onMoveShouldSetResponder={this.onMoveShouldSetResponder}
        onResponderMove={this.onResponderMove}>
      </View>
    );
  }
});

var styles = StyleSheet.create({
  box: {
    flexDirection: 'row',
    alignSelf: 'center',
    width: 200,
    height: 50,
    backgroundColor: 'red'
  }
});

React Native 0.22.0 OSX

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 5
  • Comments: 28 (17 by maintainers)

Most upvoted comments

Still seeing this in 0.43.4

Still seeing in 0.35.0

Still seeing in 0.45.0