Commit 36f07a1
Fix importantForInteraction mapping for AUTO and BOX_ONLY pointer events (#55336)
Summary:
Pull Request resolved: #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: a2eb2272c44cf44379011294a3f18fdb93bf74251 parent 0cde8ed commit 36f07a1
1 file changed
Lines changed: 10 additions & 6 deletions
File tree
- packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/view
Lines changed: 10 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
37 | 42 | | |
38 | | - | |
| 43 | + | |
39 | 44 | | |
40 | 45 | | |
41 | | - | |
42 | | - | |
| 46 | + | |
| 47 | + | |
43 | 48 | | |
44 | 49 | | |
45 | 50 | | |
| |||
49 | 54 | | |
50 | 55 | | |
51 | 56 | | |
52 | | - | |
| 57 | + | |
53 | 58 | | |
54 | 59 | | |
55 | | - | |
56 | | - | |
| 60 | + | |
57 | 61 | | |
58 | 62 | | |
59 | 63 | | |
| |||
0 commit comments