Skip to content
This repository has been archived by the owner on Sep 16, 2020. It is now read-only.

TouchableHighlight child on 6s+ #38

Closed
deanmcpherson opened this issue Sep 25, 2015 · 8 comments
Closed

TouchableHighlight child on 6s+ #38

deanmcpherson opened this issue Sep 25, 2015 · 8 comments

Comments

@deanmcpherson
Copy link

Hey @dancormier, I'm having some issues getting this to work on the 6s+. It works as expected on every other device I've tested, but a child TouchableHighlight does not respond to being pressed on a 6s+. This may be an issue with react-native itself.

The swipeout action itself works, but the panResponder appears to block the onPress from firing on child elements. I did some research and found https://botbot.me/freenode/reactnative/2015-08-28/?page=8 which refers to a similar issue, though I was wondering whether something in the new "3d touch" that may get in the way of correctly passing the onPress action.

@coderdave
Copy link

I'm also having the same issue ONLY on my iPhone 6s. As @deanmcpherson was saying, it works fine on all of my other devices and also the 6s simulator.

I also thought it has something to do with 3d touch, but I disabled it on my phone and was still having the issue. (However, I'm not sure if disabling it in settings is the same as not having that feature at all on a phone)

I haven't tested if it on an iPhone 6s plus.

@deanmcpherson
Copy link
Author

@coderdave It is the same on the 6s and 6s plus, I'll see if I can debug it today.

@deanmcpherson
Copy link
Author

As per facebook/react-native#3082, this was resolved for me by checking if dy/ dx is not 0 before granting a PanResponder in onMoveShouldSetPanResponder.

@coderdave
Copy link

@deanmcpherson So what's the workaround code to fix it until FB fixes it internally?

@por
Copy link

por commented Oct 29, 2015

@deanmcpherson I would also like to know what your current workaround is. Can you share it?

edit: figured it out. I interpreted the / in dy / dx a bit too literal. Here’s my workaround:

_handleMoveShouldSetPanResponder: function(e: Object, gestureState: Object): boolean {
  if (gestureState.dx === 0 || gestureState.dy === 0) {
    return false;
  }
  return true;
}

@deanmcpherson
Copy link
Author

hey @por, @coderdave sorry for the slow reply, @por's solution is the same as mine.

@coderdave
Copy link

Thanks. Ok, so we're basically having to override the _handleMoveShouldSetPanResponder function in swipeout's code.

Would it make sense to update react-native-swipeout and release a new version? It seems like it's on react's radar but hasn't been fixed yet.

@techmentormaria
Copy link
Collaborator

fyi created a pull request for future reference
#47

zuoyoulian pushed a commit to zuoyoulian/react-native-swipeout that referenced this issue May 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants