Commit 3456c0a
authored
[iOS] Fix
## Description
Since some recognizers changed their own state in `reset`, it was
possible for the value to desync between the recognizer and the handler.
This could lead to issues where a "disabled" handler would block other
gestures from firing.
This PR:
- removes explicit `enabled = YES` from pan gesture, since it never
changes the value by itself
- replaces `enabled = YES` with `enabled = _gestureHandler.enabled` for
tap, since it can set its own `enabled` to `NO` to cancel itself
- removes `shouldBeRequiredToFailByGestureRecognizer` from the root
recognizer - it was added in de0ffb4,
before aligning `enabled` between recognizer and handler in
a64b425. Disabled recognizers should
never be considered for recognition, so this is effectively a no-op.
## Test plan
Tested on the provided repro:
https://github.com/pawicao/rngh-v3-testing/blob/enabled-repro/src/app/index.tsx
Zoom in, pan around, zoom out, try to scroll horizontallyenabled state diverging between the handler and its recognizer (#4140)1 parent 86bbf16 commit 3456c0a
3 files changed
Lines changed: 1 addition & 14 deletions
File tree
- packages/react-native-gesture-handler/apple
- Handlers
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
269 | 269 | | |
270 | 270 | | |
271 | 271 | | |
272 | | - | |
273 | 272 | | |
274 | 273 | | |
275 | 274 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
261 | | - | |
| 261 | + | |
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
| |||
Lines changed: 0 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | 36 | | |
49 | 37 | | |
50 | 38 | | |
| |||
0 commit comments