Skip to content

[Web] Refactor Touchable not to rely on GestureDetector#4344

Open
j-piasecki wants to merge 4 commits into
touchable-refactor-iosfrom
touchable-refactor-web
Open

[Web] Refactor Touchable not to rely on GestureDetector#4344
j-piasecki wants to merge 4 commits into
touchable-refactor-iosfrom
touchable-refactor-web

Conversation

@j-piasecki

Copy link
Copy Markdown
Member

Description

  • ActionType.NONE is added on the JS side; the web GestureHandler skips sendEvent dispatch for handlers attached with it.
  • GestureHandlerButton.web.tsx now creates and attaches its own NativeViewGestureHandler when handlerTag is set (mirroring the native platforms) and drops it on unmount.
  • The web NativeViewGestureHandler runs the same press state machine (including the long-press timer) when it manages a button, dispatching press events as DOM CustomEvents (gh:buttonPress etc.). The button listens for these and forwards them to the onButton* callbacks; managed buttons no longer drive pressed state from their own pointer handlers.
  • Touchable.web.tsx is deleted — web now uses the shared Touchable implementation.
  • Also fixes the web GestureHandler registering event listeners for initially disabled handlers (config is applied before attachment, so the enabled-change path never ran) — covered by a new unit test.

Test plan

Existing tests in the Example app

@j-piasecki
j-piasecki force-pushed the touchable-refactor-ios branch from 1e89ff8 to 4355487 Compare July 27, 2026 06:00
@j-piasecki
j-piasecki force-pushed the touchable-refactor-web branch from 2458e65 to 3c95184 Compare July 27, 2026 06:00
@j-piasecki
j-piasecki force-pushed the touchable-refactor-ios branch from 4355487 to 233649d Compare July 27, 2026 06:24
@j-piasecki
j-piasecki force-pushed the touchable-refactor-web branch from 3c95184 to 30b139b Compare July 27, 2026 06:24
@j-piasecki
j-piasecki force-pushed the touchable-refactor-ios branch from 233649d to 71d694d Compare July 27, 2026 07:32
@j-piasecki
j-piasecki force-pushed the touchable-refactor-web branch from 30b139b to 030bef7 Compare July 27, 2026 07:32
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.

1 participant