From ecb3e5bcd9c86d5ea27b0040fa60eaa8403df392 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=E1=BA=A7n=20=C4=90=C3=ACnh=20Huy?= <68500260+huytdps13400@users.noreply.github.com> Date: Sun, 4 Oct 2026 22:20:14 +0700 Subject: [PATCH 1/2] fix(android): respect pointer events on gesture root views --- apps/basic-example/src/App.tsx | 5 + apps/basic-example/src/PointerEventsRepro.tsx | 102 ++++++++++++++++++ .../react/RNGestureHandlerRootViewManager.kt | 6 ++ ...RNGestureHandlerRootViewNativeComponent.ts | 5 + 4 files changed, 118 insertions(+) create mode 100644 apps/basic-example/src/PointerEventsRepro.tsx diff --git a/apps/basic-example/src/App.tsx b/apps/basic-example/src/App.tsx index d22c7a5017..1b1fe1b360 100644 --- a/apps/basic-example/src/App.tsx +++ b/apps/basic-example/src/App.tsx @@ -5,6 +5,7 @@ import { GestureHandlerRootView } from 'react-native-gesture-handler'; import ContentsButton from './ContentsButton'; import NativeDetector from './NativeDetector'; import Navigator from './Navigator'; +import PointerEventsRepro from './PointerEventsRepro'; import RuntimeDecoration from './RuntimeDecoration'; import Text from './Text'; @@ -25,6 +26,10 @@ const EXAMPLES = [ name: 'Contents Button', component: ContentsButton, }, + { + name: 'Root Pointer Events', + component: PointerEventsRepro, + }, ]; const Stack = Navigator.create(); diff --git a/apps/basic-example/src/PointerEventsRepro.tsx b/apps/basic-example/src/PointerEventsRepro.tsx new file mode 100644 index 0000000000..1b8ccf2262 --- /dev/null +++ b/apps/basic-example/src/PointerEventsRepro.tsx @@ -0,0 +1,102 @@ +import * as React from 'react'; +import { + Button, + Pressable, + StyleSheet, + Text, + View, + type ViewProps, +} from 'react-native'; +import { + GestureDetector, + GestureHandlerRootView, + useTapGesture, +} from 'react-native-gesture-handler'; + +export default function PointerEventsRepro() { + const [mode, setMode] = + React.useState('box-none'); + const [plain, setPlain] = React.useState(false); + const [background, setBackground] = React.useState(0); + const [child, setChild] = React.useState(0); + const [gesture, setGesture] = React.useState(0); + const tap = useTapGesture({ + runOnJS: true, + onActivate: () => setGesture((n) => n + 1), + }); + const Wrapper = plain ? View : GestureHandlerRootView; + return ( + + Root pointerEvents regression + + {plain ? 'View' : 'Root'} / {mode ?? 'unset'} / background {background}{' '} + / child {child} / gesture {gesture} + +