Sitelet https://github.com/lottie-react-native/lottie-react-native/pull/1472
Skip to content

fix(android): honor pointer events on Lottie views - #1472

Open
huytdps13400 wants to merge 1 commit into
lottie-react-native:masterfrom
huytdps13400:fix/android-pointer-events
Open

huytdps13400 wants to merge 1 commit into
lottie-react-native:masterfrom
huytdps13400:fix/android-pointer-events

Conversation

@huytdps13400

Copy link
Copy Markdown
Contributor

An Android Lottie overlay with style={{ pointerEvents: 'none' }} still captures React Native's touch target, preventing buttons underneath it from receiving presses. The same overlay made with View passes the touches through.

This gives the Android animation view a ReactPointerEventsView implementation and forwards the prop through both view managers. The Fabric spec explicitly declares the prop so its generated delegate dispatches updates. Removing the prop restores auto. The example app now includes a Pointer events screen with covered buttons and a native View control.

Fixes #1294.

Verification

  • Reproduced on current master (2d60a7b), React Native 0.84.1 / Fabric / Hermes, Android 12L arm64 emulator: Lottie blocked the underlying button for both none and box-none, while the View control passed the touches through.
  • After the fix, all 12 touch checks matched the control: initial none, auto, box-none, box-only, updated none, and removal of the prop. Also opened the integrated example from the component picker and repeated the initial pass-through check.
  • Android debug APK build, library Bob build, example TypeScript check, and ESLint for the new example/registration passed.
  • Compiled the legacy manager source separately with a temporary Gradle source-set selection. Paper runtime and iOS runtime were not tested.

The local baseline and patched builds both needed Foojay resolver 1.0.0 in React Native's installed Gradle plugin to provision JDK 17 under Gradle 9. That dependency-only environment workaround is not included in this PR.

To repeat the manual regression, open Pointer events in the example app, wait for loaded: true, select each mode, and tap the center of both colored regions. Both counters should increment for none/box-none and stay unchanged for auto/box-only/unset.

@huytdps13400
huytdps13400 force-pushed the fix/android-pointer-events branch from 047cc98 to 853b783 Compare October 5, 2026 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pointer-events style ignored on Android

1 participant