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

onPress work one time only #44245

Closed
pigeonmal opened this issue Apr 24, 2024 · 5 comments
Closed

onPress work one time only #44245

pigeonmal opened this issue Apr 24, 2024 · 5 comments
Labels
Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. Needs: Attention Issues where the author has responded to feedback. Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Needs: Triage 🔍

Comments

@pigeonmal
Copy link

Description

I try to create my bottom sheet.
onPress work only one time, when pressable component is in root. Sometimes it's just the first time click, sometimes is after many clicks, and after does not work anymore.
onPressIn work perfectly

The bug is on v0.73.7 (new arch, bridgless false) and v0.74.0 (new arch, bridgless true), tested only on Android.

Steps to reproduce

(TEST ON ANDROID, v0.73.7, and v0.74.0, new arch)

  1. Create component (BottomOption), that show only with state true, with pressable for testing
  2. In App component, add BottomOption inside GestureHandlerRootView.
  3. Click pressable inside screen, that change visible state of BottomOption.
  4. Try click pressable of BottomOption.

React Native Version

0.74.0

Affected Platforms

Runtime - Android

Output of npx react-native info

System:
  OS: Windows 10 10.0.19045
  CPU: "(2) x64 AMD Athlon Silver 3050U with Radeon Graphics   "
  Memory: 426.10 MB / 3.42 GB
Binaries:
  Node:
    version: 18.19.1
    path: C:\Program Files\nodejs\node.EXE
  Yarn:
    version: 1.22.22
    path: ~\AppData\Roaming\npm\yarn.CMD
  npm:
    version: 10.2.4
    path: C:\Program Files\nodejs\npm.CMD
  Watchman: Not Found
SDKs:
  Android SDK: Not Found
  Windows SDK: Not Found
IDEs:
  Android Studio: Not Found
  Visual Studio: Not Found
Languages:
  Java: 17.0.10
  Ruby: Not Found
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.74.0
    wanted: 0.74.0
  react-native-windows: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

Stacktrace or Logs

No crash or failure in logs

I try debug onPress call with console.log("TEST");

as onPress doesn't call, console.log too.

Reproducer

github.com/pigeonmal/react-native-onpress-bug

Screenshots and Videos

This is video of my app.
Normally it's like the reproducer.

Record_2024-04-24-22-06-44.mp4
@github-actions github-actions bot added Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. labels Apr 24, 2024
Copy link

⚠️ Missing Reproducible Example
ℹ️ We could not detect a reproducible example in your issue report. Please provide either:
  • If your bug is UI related: a Snack
  • If your bug is build/update related: use our Reproducer Template. A reproducer needs to be in a GitHub repository under your username.

@cortinico cortinico added the Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. label Apr 24, 2024
@mensonones
Copy link

Descrição

Tento criar minha folha de baixo. onPress funciona apenas uma vez, quando o componente pressionável está na raiz. Às vezes é apenas o primeiro clique, às vezes depois de muitos cliques e depois não funciona mais. onPressIn funciona perfeitamente

O bug está na v0.73.7 (novo arco, bridgless falso) e v0.74.0 (novo arco, bridgless verdadeiro), testado apenas no Android.

Passos para reproduzir

(TESTE NO ANDROID, v0.73.7 e v0.74.0, novo arco)

  1. Criar componente (BottomOption), que mostra apenas com estado verdadeiro, com pressionável para teste
  2. No componente App, adicione BottomOption dentro de GestureHandlerRootView.
  3. Clique em pressionável dentro da tela, que altera o estado visível de BottomOption.
  4. Tente clicar pressionável em BottomOption.

Versão nativa do React

0,74,0

Plataformas afetadas

Tempo de execução - Android

Saída denpx react-native info

System:
  OS: Windows 10 10.0.19045
  CPU: "(2) x64 AMD Athlon Silver 3050U with Radeon Graphics   "
  Memory: 426.10 MB / 3.42 GB
Binaries:
  Node:
    version: 18.19.1
    path: C:\Program Files\nodejs\node.EXE
  Yarn:
    version: 1.22.22
    path: ~\AppData\Roaming\npm\yarn.CMD
  npm:
    version: 10.2.4
    path: C:\Program Files\nodejs\npm.CMD
  Watchman: Not Found
SDKs:
  Android SDK: Not Found
  Windows SDK: Not Found
IDEs:
  Android Studio: Not Found
  Visual Studio: Not Found
Languages:
  Java: 17.0.10
  Ruby: Not Found
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.74.0
    wanted: 0.74.0
  react-native-windows: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

Stacktrace ou registros

No crash or failure in logs

I try debug onPress call with console.log("TEST");

as onPress doesn't call, console.log too.

Reprodutor

github.com/pigeonmal/react-native-onpress-bug

Capturas de tela e vídeos

Este é o vídeo do meu aplicativo. Normalmente é como o reprodutor.

Registro_2024-04-24-22-06-44.mp4

Hey, @pigeonmal! Create a valid reproduction! I tried to adjust some things, but it still couldn't run.

image

876e5210-a590-45ba-b61f-9e245989ee2a

When the example is ok, it will be a pleasure to try to help.

@github-actions github-actions bot added Needs: Attention Issues where the author has responded to feedback. and removed Needs: Author Feedback labels Apr 25, 2024
@pigeonmal
Copy link
Author

Sorry for the slow response, I finally managed to get the bug in the reproducer.

CHECK: https://github.com/pigeonmal/react-native-onpress-bug/

I have put the same code as my app.

When newArchEnabled=false: NO BUG, pressable work
When newArchEnabled=true: BUG, pressable don't work

I don't know for the moment if this a bug in react-native, or in my packages, I must do more tests.

@necmettindev
Copy link

I think it is about "react-native-animated" not the react-native.

@pigeonmal
Copy link
Author

I try to remove react-native-reanimated, the bug has disappeared

@pigeonmal pigeonmal closed this as not planned Won't fix, can't repro, duplicate, stale May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. Needs: Attention Issues where the author has responded to feedback. Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Needs: Triage 🔍
Projects
None yet
Development

No branches or pull requests

4 participants