software-mansion / react-native-gesture-handler

Declarative API exposing platform native touch and gesture system to React Native.
https://docs.swmansion.com/react-native-gesture-handler/
MIT License
5.85k stars 954 forks source link

React-Native 0.61.0-rc.0 - Touchable* & *Button does not trigger `onPress` event. #745

Closed chillios-dev closed 4 years ago

chillios-dev commented 4 years ago

Hi,

With newest RC version, onPress event is not triggered. I'm not sure yet with GestureHandlers but I will create repro example with both 60.x & 61.x.

drewhamlett commented 4 years ago

I'm seeing this with just Android. iOS still seems to be working.

immortalx commented 4 years ago

Just to confirm, upgraded to the latest rn 0.61.0-rc.2 and onPress is not triggered in Android. iOS works fine.

JonnyBurger commented 4 years ago

With 0.61.0-rc.2 also all the components relying on PanGestureHandler don't seem to work. Native Swipeable and react-native-modalize don't accept any swipe gestures anymore.

rafaelmotta commented 4 years ago

I don't know why, but in my simulator, I don't get any issue, but in production I get. My problem was also in the library react-native-modalize, which uses react-native-gesture-handler under the hood.

This is the issue I got in sentry: Unsupported top level event type "onGestureHandlerStateChange" dispatched

Ended reverting to 0.60.5

siderakis commented 4 years ago

Did anyone find a workaround for Android?

Possibly a duplicate of https://github.com/kmagiera/react-native-gesture-handler/issues/729

SpawnAtis commented 4 years ago

I tried 0.61-rc.3. It has such problem only on Android. AndroidX was enabled.

jfrolich commented 4 years ago

I found the code snipped in this issue #320 fixes the issue:

for (let k in UIManager) {
  if (
    UIManager.hasOwnProperty(k) &&
    UIManager[k] &&
    UIManager[k].directEventTypes
  ) {
    UIManager[k].directEventTypes.onGestureHandlerEvent = {
      registrationName: 'onGestureHandlerEvent',
    }
    UIManager[k].directEventTypes.onGestureHandlerStateChange = {
      registrationName: 'onGestureHandlerStateChange',
    }
  }
}
dqbd commented 4 years ago

Using gestureHandlerRootHOC has worked for me instead:

https://github.com/react-native-community/releases/issues/140#issuecomment-532819601

jfrolich commented 4 years ago

Using gestureHandlerRootHOC has worked for me instead:

react-native-community/releases#140 (comment)

That didn't work for me. But that was 0.61-rc.0, didn't test after that.

chillios-dev commented 4 years ago

@kmagiera I'm closing this as RNGH is working properly with RN 61.1.

Thanks 🙌 🙌 🙌

lake2 commented 4 years ago

same issue on RN 61.2

panda0603 commented 4 years ago

still seems not to be fixed in RN 0.61.5

curiousdustin commented 4 years ago

I have been able to reproduce this behavior in the current example app.

https://github.com/software-mansion/react-native-gesture-handler/issues/920

Artoering commented 4 years ago

@panda0603 me too, after read the documentation follow that step still seems not to be fixed in RN 0.61.5

avinashlng1080 commented 4 years ago

Any update on this ticket please?

qayyummdnoor commented 4 years ago

Yup, confirm android RN 0.61.5 PanGestureHandler not working, any update or workaround?

avinashlng1080 commented 4 years ago

Can anyone please point us to a solution ?

avinashlng1080 commented 4 years ago

I was having the same issue and then by removing the useScreen() function from react-navigation, all the touches on Android went through. It might be helpful to note it.

qayyummdnoor commented 4 years ago

I found a workaround, replace componentDidUpdate() to UNSAFE_componentWillUpdate(), working on RN 0.61.5.

todorone commented 3 years ago

@dsznajder This issue can be reproduced with the latest RN version, could You please reopen the issue?

saczuac commented 3 years ago

Same issue here

callaars commented 3 years ago

For me, the problem was solved by using the Touchable* from the react-native-gesture-handler package instead of the ones from react-native. On RN 0.63 it also doesn't work with the new Pressable component.

jfrolich commented 3 years ago

I found that this happens after opening a modal. All touchables or gestures stop working. When you remove flipper from the app the problem is gone. So it's probably a new bug in flipper.