dcangulo / react-native-outside-press

airbnb/react-outside-click-handler but for React Native.
https://www.npmjs.com/package/react-native-outside-press
MIT License
127 stars 6 forks source link

Cannot work with Pressable #371

Open Coolister-Ye opened 2 months ago

Coolister-Ye commented 2 months ago

I just found that outside-press cannot be work with <Pressable> element. Please find a minimal example below. Any suggestion would be helpful. I'm using this package with expo and web.

<Pressable>click here dosn't work</Pressable>
<OutsidePressHandler onOutsidePress={console.log("press outside")}>
  <Text>001</Text>
</OutsidePressHandler>
cf-david-m commented 2 days ago

I just encountered the same issue, is there a solution yet?

cf-david-m commented 2 days ago

I fixed the problem (for web) by replacing the onClick in Container and OutsidePressHandler components with onPointerDown. Can this create issues with other components than Pressable?

I forked the project and created a PR https://github.com/dcangulo/react-native-outside-press/pull/373