Describe the bug
Setting pointerEvents: 'box-none' on a View prohibits triggering onTouch* or onLayout events on the View. This behavior differs from React Native itself. This Expo Snack showcases that pressing the child Pressable of a <View pointerEvents="box-none" /> still triggers the onTouchStart and onTouchEnd events. This change in behavior, which appears to differ from React Native, began in with 7.2.0 due to changes in #655.
Expected behavior
Invoking fireEvent.trigger(viewWithPointerEventsBoxNone, "onTouchStart") results in triggering the View's onTouchStart handler.
Similarly, invoking fireEvent.trigger(viewWithPointerEventsBoxNone, "onLayout") results in triggering the View's onLayout handler.
Steps to Reproduce
- Press the "Press me" text in the Expo Snack to observe the expected behavior.
- Clone the reproduction case, specifically the
pointerevents-box-none-and-ontouchevents branch.
npm install
npm run test
Screenshots
n/a
Versions
npmPackages:
@testing-library/react-native: ^9.0.0 => 9.0.0
react: 17.0.2 => 17.0.2
react-native: 0.66.4 => 0.66.4
react-test-renderer: 17.0.2 => 17.0.2