Commit 9c6f72c
authored
[Web] Remove explicit reset from
## Description
#4128
changed how handlers kept in the orchestrator are treated - those can
now influence other handlers' state. When trying to use the `Touchable`
component in the example app, I've noticed that other buttons become
unresponsive after scrolling cancels the pressed button.
This turned out to be caused by an explicit `reset` call inside
`onPointerCancel`. This caused the handler's state to go to
`UNDETERMINED` between the change to `CANCELED` and the time the
orchestrator runs `cleanupFinishedHandlers`. When the orchestrator goes
over the handlers to clean, it ignores handlers that are not in a
finished state. Since the gesture changed to `UNDETERMINED`, it was kept
in the orchestrator after being canceled.
Note that the handler is still being reset by the orchestrator in a
scheduled microtask.
## Test plan
I replaced `RectButtons` on in the example app list with `Touchables`
|Before|After|
|-|-|
|<video
src="https://github.com/user-attachments/assets/84f64388-9cac-4ac5-bc05-afc03007178e"
/>|<video
src="https://github.com/user-attachments/assets/262d0215-3360-42a7-bb53-02ec1b8488ab"
/>|onPointerCancel (#4133)1 parent 5460083 commit 9c6f72c
2 files changed
Lines changed: 0 additions & 6 deletions
File tree
- packages/react-native-gesture-handler/src/web/handlers
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
363 | 363 | | |
364 | 364 | | |
365 | 365 | | |
366 | | - | |
367 | 366 | | |
368 | 367 | | |
369 | 368 | | |
| |||
Lines changed: 0 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | 55 | | |
0 commit comments