Skip to content

Touch gestures cancelled when using Gesture.Manual() over DatadogWebView (iOS) #1104

@radko93

Description

@radko93

Describe the bug

We have a new regression that popped up just after upgrading to Datadog 2.14.0. We have an Touch Overlay (gesture tracker that shows where user makes a touch) and it breaks after the recent update to Datadog Webview.

Reproduction steps

  1. Wrap a DatadogWebView with a gesture handler using Gesture.Manual()
  2. Use Gesture.Simultaneous() to allow both the gesture and WebView to receive touches
  3. Navigate within the WebView to make it interactive
  4. Touch and drag on the WebView

Expected Behavior

  • onTouchesDown fires when touch starts
  • onTouchesMove fires during drag
  • onTouchesUp fires when touch ends

Actual Behavior

  • onTouchesDown fires when touch starts
  • onTouchesMove fires briefly (sometimes)
  • onTouchesCancelled fires almost immediately (within ~6ms based on animation progress)
  • onTouchesUp never fires

Minimal Reproduction Code

import WebView from "@datadog/mobile-react-native-webview";
import { Gesture, GestureDetector, GestureHandlerRootView } from "react-native-gesture-handler";
import { View } from "react-native";

const TouchOverlay = ({ children }) => {
  const overlayGesture = Gesture.Manual()
    .shouldCancelWhenOutside(false)
    .onTouchesDown((event) => {
      console.log("[TouchOverlay] onTouchesDown", event.allTouches.length);
    })
    .onTouchesMove((event) => {
      console.log("[TouchOverlay] onTouchesMove");
    })
    .onTouchesUp((event) => {
      // This never fires when WebView is interactive
      console.log("[TouchOverlay] onTouchesUp");
    })
    .onTouchesCancelled((event) => {
      // This fires instead of onTouchesUp
      console.log("[TouchOverlay] onTouchesCancelled");
    });

  const scrollGesture = Gesture.Native();
  const combinedGesture = Gesture.Simultaneous(scrollGesture, overlayGesture);

  return (
    <GestureHandlerRootView style={{ flex: 1 }}>
      <GestureDetector gesture={combinedGesture}>
        <View style={{ flex: 1 }}>
          {children}
        </View>
      </GestureDetector>
    </GestureHandlerRootView>
  );
};

// Usage
const App = () => (
  <TouchOverlay>
    <WebView source={{ uri: "https://example.com" }} />
  </TouchOverlay>
);

Workaround

Using the standard react-native-webview instead of @datadog/mobile-react-native-webview resolves the issue. Touch gestures work correctly with the non-Datadog WebView.

// This works correctly
import WebView from "react-native-webview";

Console Logs

Before WebView interaction (working correctly):

[TouchOverlay] onTouchesDown
[TouchOverlay] onTouchesMove (multiple times)
[TouchOverlay] onTouchesUp ✅

After WebView becomes interactive (broken):

[TouchOverlay] onTouchesDown
[TouchOverlay] onTouchesMove (0-2 times)
[TouchOverlay] onTouchesCancelled ❌ (onTouchesUp never fires)

SDK logs

No response

Expected behavior

No response

Affected SDK versions

2.14.0

Latest working SDK version

2.13.2

Did you confirm if the latest SDK version fixes the bug?

Yes

Integration Methods

Yarn

React Native Version

0.81.5, Expo 54

Package.json Contents

react-native-gesture-handler: 2.20.2

iOS Setup

No response

Android Setup

No response

Device Information

iPhone 17 Pro, iOS 26.2

Other relevant information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions