software-mansion / react-native-gesture-handler

Declarative API exposing platform native touch and gesture system to React Native.

Home Page:https://docs.swmansion.com/react-native-gesture-handler/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Web] Nested Pressable inside a Swipeable captures press when swiping

milan-digiuseppe-level opened this issue · comments

Description

Nesting a Pressable component inside a Swipeable works as expected on mobile:

  1. tapping the Pressable content fires its onPress
  2. swiping the Swipeable works as expected and does not fire the Pressable onPress

However, on web:

  1. tapping the Pressable content fires its onPress
  2. swiping the Swipeable works as expected but also fires the Pressable onPress
nested.pressable.ios.mov
nested.pressable.web.mov

Steps to reproduce

  1. Clone linked repository for minimum reproducible example
  2. Run app on web
  3. Swipe the swipeable row
  • Expected: onPress isn't fired
  • Actual: onPress is fired, alert is shown

Snack or a link to a repository

https://github.com/milan-digiuseppe-level/swipeable-nested-pressable-mvp

Gesture Handler version

2.14.1

React Native version

0.73.6

Platforms

iOS, Web

JavaScript runtime

None

Workflow

Expo managed workflow

Architecture

None

Build type

Debug mode

Device

None

Device model

No response

Acknowledgements

Yes

Seeing a similar issue on iOS.