Repository navigation
Description
Description
On Android, a View with pointerEvents="box-only", and every view inside a ScrollView with scrollEnabled={false}, gets no hover: a stylus hovering them makes none of them send TYPE_VIEW_HOVER_ENTER.
ReactViewGroup.dispatchGenericMotionEvent(L320-L327) returnsfalsewhilecanChildrenBeTouchTarget(pointerEvents)is false, which holds forbox-onlyas well asnone, so abox-onlyview never runs its own hover handling, thoughcanBeTouchTargetkeeps it a touch target (PointerEvents.ktL51-L58). The check came with Apply pointerEvents dispatch check in dispatchGenericMotionEvent #43433, for the children of anoneview.ReactScrollView(L625-L627),ReactHorizontalScrollView(L781-L786) andReactNestedScrollView(L633-L635) returnfalsefromdispatchGenericMotionEventwhilescrollEnabledis false, which drops a hover along with the mouse wheel.
Related: #59046, where a ReactViewGroup skips View.onHoverEvent while dispatchPointerEvents is on.
Steps to reproduce
The reproducer renders three accessible Views: auto View with the default pointerEvents, box-only View with pointerEvents="box-only", and View inside a ScrollView with scrollEnabled false.
- Clone the reproducer and, with one Android 11 or newer device attached, run
./reproduce.sh. It builds and installs the release APK, hovers a stylus registered through the device'suinputover each View, above its label, and readsadb shell uiautomator events. - Or by hand:
cd ReproducerApp/android && ./gradlew assembleRelease && adb install -r app/build/outputs/apk/release/app-release.apk, open the app, runadb shell uiautomator events, and hover a mouse or a stylus over each View, above its label.
Expected: each View sends TYPE_VIEW_HOVER_ENTER, as auto View does; the children of a box-only View and a none View still get no hover, and a ScrollView with scrollEnabled={false} still ignores the mouse wheel.
Seen: only auto View sends one.
React Native Version
0.90.0-nightly-20261111-1273ca128
Affected Platforms
Runtime - Android
Output of npx @react-native-community/cli info
System:
OS: Windows 11 10.0.26300
CPU: "(32) x64 AMD Ryzen 9 9950X3D 16-Core Processor "
Memory: 98.76 GB / 255.67 GB
Binaries:
Node:
version: 26.12.1
path: C:\Program Files\nodejs\node.EXE
Yarn:
version: 1.22.22
path: C:\Users\<user>\AppData\Roaming\npm\yarn.CMD
npm:
version: 12.2.1
path: C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK: Not Found
Windows SDK:
AllowDevelopmentWithoutDevLicense: Enabled
Versions:
- 10.0.19041.0
- 10.0.26100.0
IDEs:
Android Studio: AI-262.9437.185.2621.16467767
Visual Studio: Not Found
Languages:
Java:
version: 17.0.20.1
path: C:\Program Files\Microsoft\jdk-17.0.20.101-hotspot\bin\javac.EXE
Ruby: Not Found
npmPackages:
"@react-native-community/cli":
installed: 21.0.0-alpha.1
wanted: 21.0.0-alpha.1
react:
installed: 19.3.0
wanted: 19.3.0
react-native:
installed: 0.90.0-nightly-20261111-1273ca128
wanted: 0.90.0-nightly-20261111-1273ca128
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 error is logged. ./reproduce.sh at the reproducer's ebbf040, on a Galaxy S23:
device: SM-S911B, Android 14 (API 34), arm64-v8a
react-native 0.90.0-nightly-20261111-1273ca128
== ./gradlew :app:assembleRelease -PreactNativeArchitectures=arm64-v8a
hovering "auto View" at (540, 237)
hovering "box-only View" at (540, 729)
hovering "View inside a ScrollView with scrollEnabled false" at (540, 1221)
auto View: TYPE_VIEW_HOVER_ENTER
box-only View: no TYPE_VIEW_HOVER_ENTER
View inside a ScrollView with scrollEnabled false: no TYPE_VIEW_HOVER_ENTER
SUMMARY: a hover reaches the auto View but neither the box-only View nor the View inside the ScrollView with scrollEnabled={false}
ReactViewGroup.kt, the three scroll views and PointerEvents.kt are the same on main at 6125a5d as at this nightly's 1273ca1.
MANDATORY Reproducer
https://github.com/YevheniiKotyrlo/rn-box-only-hover-repro
Screenshots and Videos
No response
Activity