Skip to content

GestureDetector can interfere with text selection inside webview on Android #3900

@Nantris

Description

@Nantris

Description

Copied from original report on #3196:

@m-bert thanks again for your great work on this!

Unfortunately I finally discovered a problem with this approach when I discovered a feature of Android I was previously unaware existed. It's not a showstopper, but it is a bummer I'm hoping to work around somehow.

On Android if you longpress an area to select a word and then drag, it will select the area that the gesture spans across in the contentEditable, textarea, non-editable text, etc.

Unfortunately wrapping with <GestureDetector gesture={native}> breaks this behavior completely. The longpress works but dragging to continue the selection does nothing.

Is there any way you can see to work around this either with the tools available now or in the future?


Working

Screen_Recording_20250529_165905.mp4

Non-working (Wrapped with Native GestureHandler)

Screen_Recording_20250529_165955.mp4

Steps to reproduce

  1. Longpress a word to begin a selection that contains that word
  2. Drag your finger across more text to expand the selection. Without GestureHandler this will work but but with GestureHandler the selection will stop on the longpressed word and not be expandable as part of the same selection gesture.

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

Repro Snack

Gesture Handler version

2.28.0

React Native version

0.81.5

Platforms

Android

JavaScript runtime

Hermes

Workflow

Using Expo Prebuild or an Expo development build

Architecture

New Architecture (Fabric)

Build type

Debug mode

Device

Real device

Device model

Galaxy S24 on Android 16 (Android 15 also affected)

Acknowledgements

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    Platform: AndroidThis issue is specific to AndroidRepro providedA reproduction with a snack or repo is provided

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions