Commit 7453280
[Android | Web] Disable pointer events on hidden
## Description
The left/right action containers in `ReanimatedSwipeable` are
absolute-fill
overlays that animate to `opacity: 0` when not revealed. On Android, an
opacity-0 view still receives touches, so the hidden side stays on top
in
z-order and swallows taps that should reach the visible side's actions
(or the row content itself). A common repro is a quick-action button
exposed by a swipe: the button visibly responds to press feedback but
the
`onPress` never fires because the opposite-side container intercepts it.
This adds a matching `pointerEvents` toggle to `leftActionAnimation` and
`rightActionAnimation`, so each container becomes `'none'` alongside its
opacity going to 0, and switches back to `'auto'` once revealed. iOS and
web were not affected by the original bug, but the toggle is harmless on
those platforms (an opacity-0 view there is already non-interactive).
Fixes #3223.
## Test plan
- Carried as a local patch against `react-native-gesture-handler@2.28.0`
in our app for the last few weeks. Before the patch, Android taps on a
swipe-revealed action were dropped intermittently; after the patch,
every tap fires on the first try. iOS behavior was unchanged.
- Manual repro for reviewers: in `apps/common-app`, open a `Swipeable`
example, swipe a row to reveal an action, and tap the action on
Android — the action should fire on the first tap.
---------
Co-authored-by: Michał <michal.bert@swmansion.com>
Co-authored-by: Michał Bert <63123542+m-bert@users.noreply.github.com>Swipeable actions container (#4192)1 parent 50cb5a6 commit 7453280
1 file changed
Lines changed: 8 additions & 0 deletions
File tree
- packages/react-native-gesture-handler/src/components/ReanimatedSwipeable
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
393 | 393 | | |
394 | 394 | | |
395 | 395 | | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
396 | 400 | | |
397 | 401 | | |
398 | 402 | | |
| |||
423 | 427 | | |
424 | 428 | | |
425 | 429 | | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
426 | 434 | | |
427 | 435 | | |
428 | 436 | | |
| |||
0 commit comments