Skip to content

[RUM-17322] 🐛 Do not record touch scroll gestures as click actions - #4892

Draft
Valpertui wants to merge 2 commits into
mainfrom
valentin.pertuisot/fix-webview-scroll-false-click
Draft

[RUM-17322] 🐛 Do not record touch scroll gestures as click actions#4892
Valpertui wants to merge 2 commits into
mainfrom
valentin.pertuisot/fix-webview-scroll-false-click

Conversation

@Valpertui

Copy link
Copy Markdown
Member

On Android WebViews, when the native layer handles a scroll gesture the page receives pointerdown -> pointerup (no pointercancel, and the browser suppresses its own synthetic click) even though the finger moved. The action tracker equated any pointerdown -> pointerup pair with a click, so these scrolls were recorded as (mostly dead) click actions, polluting analytics funnels.

Add a movement guard in listenActionEvents: a touch/pen pointer that travels more than ACTION_SCROLL_DISTANCE_THRESHOLD (10px) between pointerdown and pointerup is treated as a scroll/drag and not recorded as a click. Mouse is unchanged.

Motivation

Changes

Test instructions

Checklist

  • Tested locally
  • Tested on staging
  • Added unit tests for this change.
  • Added e2e/integration tests for this change.
  • Updated documentation and/or relevant AGENTS.md file

On Android WebViews, when the native layer handles a scroll gesture the page
receives pointerdown -> pointerup (no `pointercancel`, and the browser suppresses
its own synthetic `click`) even though the finger moved. The action tracker
equated any pointerdown -> pointerup pair with a click, so these scrolls were
recorded as (mostly dead) click actions, polluting analytics funnels.

Add a movement guard in `listenActionEvents`: a touch/pen pointer that travels
more than ACTION_SCROLL_DISTANCE_THRESHOLD (10px) between pointerdown and
pointerup is treated as a scroll/drag and not recorded as a click. Mouse is
unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Jul 17, 2026

Copy link
Copy Markdown

Pipelines  Tests

⚠️ Warnings

🚦 2 Pipeline jobs failed

DataDog/browser-sdk | format   View in Datadog   GitLab

Lint PR title | lint   View in Datadog   GitHub Actions

ℹ️ Info

No other issues found (see more)

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 80.00%
Overall Coverage: 77.23% (+0.02%)

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 3d03801 | Docs | Datadog PR Page | Give us feedback!

Cover the cases raised in review: touch jitter below the browser's click slop
is kept, exactly-at-threshold kept, just-past discarded, euclidean/diagonal
distance, pen drag discarded / pen tap kept, mouse never discarded at any
distance, and pointercancel (no pointerup) produces no action.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@cit-pr-commenter-54b7da

Copy link
Copy Markdown

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 178.53 KiB 178.70 KiB +170 B +0.09%
Rum Profiler 8.22 KiB 8.22 KiB 0 B 0.00%
Rum Recorder 21.12 KiB 21.12 KiB 0 B 0.00%
Logs 55.59 KiB 55.59 KiB 0 B 0.00%
Rum Slim 136.60 KiB 136.76 KiB +170 B +0.12%
Worker 22.96 KiB 22.96 KiB 0 B 0.00%

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