Commit b6ccdc6
fix(android): touch interceptor must ignore pointerEvents none/box-none (#39)
`SandboxTouchInterceptor.isObscuredAt` decided whether a sandbox is covered by
an overlay using only the sibling's visibility + bounds — it never checked
`pointerEvents`. React Native's AppContainer adds a full-screen
`pointerEvents="box-none"` overlay in dev (LogBox / the element inspector),
drawn on top of everything. That overlay was treated as obscuring, so every
touch landing in a sandbox was rerouted via `redispatchWithHiddenSandbox` and
the sandbox became untappable — but only in debug builds (release has no such
overlay), which makes it very easy to miss.
Fix: skip siblings whose `pointerEvents` is NONE (fully transparent to touch),
and skip the own-bounds test for BOX_NONE (its own box passes touch through;
only its children can catch). Descendant checks are unchanged.
Follow-up to #33 (the interceptor introduced there).
Co-authored-by: André Kelmanson <andre@grana.capital>1 parent c7cc802 commit b6ccdc6
1 file changed
Lines changed: 27 additions & 10 deletions
File tree
- packages/react-native-sandbox/android/src/main/java/io/callstack/rnsandbox
Lines changed: 27 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| |||
338 | 340 | | |
339 | 341 | | |
340 | 342 | | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
351 | 368 | | |
352 | 369 | | |
353 | 370 | | |
| |||
0 commit comments