callstack / callstack/react-native-pager-view

[iOS] Press event inside Pager View not firing when using E2E Detox tests

Aperta
#1,081 1 commento 1 reazione 0 assegnatari Vedi su GitHub
Lingua principale
TypeScript
Stelle
3.4k
Fork
476
Merge medio
10g 21h
PR unite (30g)
2

Descrizione

## Environment

Environment details

```
Binaries:
Node:
version: 22.14.0
Yarn:
version: 1.22.22
npm:
version: 11.6.2
Managers:
CocoaPods:
version: 1.16.2
SDKs:
iOS SDK:
Platforms:
- DriverKit 25.5
- iOS 26.5
- macOS 26.5
- tvOS 26.5
- visionOS 26.5
- watchOS 26.5
Android SDK: Not Found
IDEs:
Android Studio: 2025.1 AI-251.27812.49.2514.14217341
Xcode:
version: 26.5/17F42
Languages:
Java:
version: 17.0.11
Ruby:
version: 2.6.10
npmPackages:
"@react-native-community/cli":
installed: 20.0.0
wanted: 20.0.0
react:
installed: 19.2.0
wanted: 19.2.0
react-native:
installed: 0.83.5
wanted: 0.83.5
Android:
hermesEnabled: true
newArchEnabled: true
iOS:
hermesEnabled: true
newArchEnabled: true
```

## Description

When trying to press/trigger a Pressable/TouchableOpacity (nested inside a `PagerView`) using Detox's `tap()`, it doesn't fire the `onPress` handler. Detox finds the element and the "press" visual hint is visible on top of the button but the `onPress` is never fired.

Using either
```
const AnimatedPagerView = Animated.createAnimatedComponent(PagerView);
```
or `PagerView` directly doesn't make a difference.

See attached video:

* First click on 00:03 is from Detox
* The swipe and click after that is manual from me

## Reproducible Demo

I've attached a simple repo for reproducing the issue using the following:

```
"react": "19.2.0",
"react-native": "0.83.5",
"react-native-pager-view": "^8.0.2",
```

To build and run use:

```
npm install
cd ios && pod install # for iOS
npm run e2e:build
npm run e2e:test
```

[RN0835PagerViewDetox.zip](https://github.com/user-attachments/files/28500454/RN0835PagerViewDetox.zip)

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia con la demo riproducibile allegata ed esegui npm install, cd ios && pod install, npm run e2e:build e npm run e2e:test. Confronta il tap di Detox all’interno di PagerView con l’interazione manuale, quindi traccia i punti di ingresso della gestione degli eventi di PagerView e iOS esposti dalla demo. Il lavoro è completato quando l’onPress annidato di Pressable o TouchableOpacity viene attivato con Detox senza compromettere le pressioni manuali.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
ios, react-native, typescript
Ambito
mobile, testing-qa
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.