Skip to content

[Pressable] Gesture is not cleaned up if component becomes unmounted while the gesture is active on Web #3608

Open
@gigobyte

Description

@gigobyte

Description

So far I've only observed this issue on Web. If a Pressable gets unmounted immediately after its buttonGesture enters active state, then it becomes stuck and continues cancelling other gesture handlers even though its DOM node doesn't exist anymore.

Steps to reproduce

  1. Render the example component from the gist
  2. Click the TextInput to focus it
  3. Press Enter
  4. Try pressing the newly appeared button and observe no logs in the console
Screen.Recording.2025-07-11.at.12.38.42.mov

A link to a Gist, an Expo Snack or a link to a repository based on this template that reproduces the bug.

https://gist.github.com/gigobyte/70903354799073ba0f9f657d0ffc3f48

Gesture Handler version

2.27.1

React Native version

0.79.0

Platforms

Web

JavaScript runtime

None

Workflow

None

Architecture

None

Build type

None

Device

None

Device model

No response

Acknowledgements

Yes

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions