Skip to content

[Web] Remove explicit reset from onPointerCancel#4133

Merged
j-piasecki merged 1 commit into
mainfrom
@jpiasecki/remove-explicit-reset-on-cancel
Apr 30, 2026
Merged

[Web] Remove explicit reset from onPointerCancel#4133
j-piasecki merged 1 commit into
mainfrom
@jpiasecki/remove-explicit-reset-on-cancel

Conversation

@j-piasecki

@j-piasecki j-piasecki commented Apr 29, 2026

Copy link
Copy Markdown
Member

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
Screen.Recording.2026-04-29.at.13.02.06.mov
Screen.Recording.2026-04-29.at.13.01.27.mov

Copilot AI review requested due to automatic review settings April 29, 2026 11:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a web-specific orchestration edge case where Touchable (and similar handlers) could remain in the GestureHandlerOrchestrator after being cancelled, causing unrelated buttons to become unresponsive.

Changes:

  • Removes the explicit reset() call from GestureHandler.onPointerCancel so handlers remain in CANCELLED until the orchestrator’s scheduled cleanup resets/removes them.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@j-piasecki j-piasecki force-pushed the @jpiasecki/remove-explicit-reset-on-cancel branch from 0265d8e to dba0388 Compare April 29, 2026 12:52
@j-piasecki j-piasecki merged commit 9c6f72c into main Apr 30, 2026
2 checks passed
@j-piasecki j-piasecki deleted the @jpiasecki/remove-explicit-reset-on-cancel branch April 30, 2026 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants