react-native-paper icon indicating copy to clipboard operation
react-native-paper copied to clipboard

Chip onPress doesn't work on android device

Open JamieColclough opened this issue 1 year ago • 7 comments

Current behaviour

Since a recent react native update, when pressing on a <Chip> component, the onPress event is not fired, although the onPressIn and onPressOut events still work

Expected behaviour

The onPress event should fire when pressing a <Chip> component

How to reproduce?

Create a <Chip> component as follows:

<Chip
    icon={'information'}
     onPress={() => {
         console.log('onPressed')
     }}
     onPressIn={() => {
         console.log('press in')
     }}
     onPressOut={() => {
         console.log('press out')
     }}
>
     Hello
</Chip>

And observe what logs are called when clicking on it

What have you tried so far?

Stripping out any functionality that may affect the onPress so it's just console.logs in the method now

Your Environment

software version
android min sdk version 24 (error occurs in multiple devices)
react-native 0.73.6
react-native-paper 5.12.3
node 18.20.2
npm or yarn 3.6.4

JamieColclough avatar May 08 '24 10:05 JamieColclough

I am having similar issues also with the Button component on an android device. I don't want to swap every use of the component to onPressIn so an update on this will be helpful

JamieColclough avatar May 08 '24 15:05 JamieColclough

It would be great if you could reproduce the bug on https://snack.expo.dev/

raajnadar avatar May 09 '24 07:05 raajnadar

I'm having the same issue within Menu Items wrapped by TouchableRipple, onPress does not work on Android, but onPressIn does work. Issue occurs since upgrading to react-native 0.74 (in combination with New Architecture).

benjaminkomen avatar May 10 '24 22:05 benjaminkomen

Same issue here - no issues before switching to the New Architecture. It's only occurring some of the time, oddly. Hopefully the Paper team can get this sorted out since React Native is moving faster and faster toward New Architecture/Fabric Bridgeless being the default for RN.

micahlt avatar Jul 10 '24 15:07 micahlt

Bugs with runnable code will get more preference and easy to debug the issue

raajnadar avatar Jul 11 '24 06:07 raajnadar

Understood, and I'm planning on making a Snack to replicate this. Just haven't gotten around to it.

micahlt avatar Jul 11 '24 12:07 micahlt

Is there any workarounds?

RohovDmytro avatar Aug 29 '24 17:08 RohovDmytro

Tested on the latest version - 5.13.3 - the issue is not valid anymore.

lukewalczak avatar Apr 18 '25 09:04 lukewalczak