SIGN IN SIGN UP
facebook / react-native UNCLAIMED

A framework for building native applications using React

Fix importantForInteraction mapping for AUTO and BOX_ONLY pointer events (#55336)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55336

Changelog: [Internal]

The previous mapping was conceptually incorrect:
- `pointerEvents=auto -> importantForInteraction=yes` was wrong because a view with `pointerEvents=auto` that is not clickable shouldn't have `importantForInteraction=yes`
- `pointerEvents=box-only -> importantForInteraction=yes | excludeDescendants` was also wrong for the same reason - the view itself being important for interaction depends on whether it's clickable, not just on pointer events

The fix:
- For `AUTO`: Skip setting the tag entirely and let the view's own state (e.g., isClickable) determine whether it's important for interaction
- For `BOX_ONLY`: Only set `excludeDescendants` to indicate descendants are not important, but let the view's own state determine if the view itself is important for interaction

This ensures that views are only marked as important for interaction when they are actually interactive (clickable), rather than incorrectly assuming importance based solely on pointer events.

Reviewed By: twasilczyk, tomscallon

Differential Revision: D91606360

fbshipit-source-id: a2eb2272c44cf44379011294a3f18fdb93bf7425
F
Fabrizio Cucci committed
36f07a1b29277a788cf8ee31626b31a014248bd1
Parent: 0cde8ed
Committed by meta-codesync[bot] <215208954+meta-codesync[bot]@users.noreply.github.com> on 1/27/2026, 9:07:08 PM