Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chip onPress doesn't work on android device #4399

Open
JamieColclough opened this issue May 8, 2024 · 3 comments
Open

Chip onPress doesn't work on android device #4399

JamieColclough opened this issue May 8, 2024 · 3 comments
Labels

Comments

@JamieColclough
Copy link

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
Copy link
Author

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

@raajnadar
Copy link
Collaborator

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

@benjaminkomen
Copy link

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants