fix(react): prevent gesture tap from firing on slider interactions#1361
Merged
fix(react): prevent gesture tap from firing on slider interactions#1361
Conversation
React's synthetic `stopPropagation` doesn't prevent native pointer events from reaching the gesture coordinator in time. Two fixes: 1. Move `stopPropagation()` before the `capturedPointerId` guard in the slider's `onPointerUp` so it always blocks propagation, even when no pointer was captured. 2. Add `[data-interactive]` to the interactive selector so any element can opt into gesture filtering via a data attribute. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
✅ Deploy Preview for vjs10-site ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
📦 Bundle Size Report🎨 @videojs/html — no changesPresets (7)
Media (8)
Players (3)
Skins (17)
UI Components (25)
Sizes are marginal over the root entry point. ⚛️ @videojs/react — no changesPresets (7)
Media (7)
Skins (14)
UI Components (20)
Sizes are marginal over the root entry point. 🧩 @videojs/core — no changesEntries (9)
🏷️ @videojs/element — no changesEntries (2)
📦 @videojs/store — no changesEntries (3)
🔧 @videojs/utils — no changesEntries (10)
📦 @videojs/spf — no changesEntries (3)
ℹ️ How to interpretAll sizes are standalone totals (minified + brotli).
Run |
…erer Add e2e tests verifying that clicking a slider does not trigger the parent container gesture (togglePaused). Also adds a React-specific gesture test suite to catch synthetic event propagation issues. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit c8a78fc. Configure here.
Replace 5s polling timeout with a short wait + instant check so the test fails fast when a gesture leaks through instead of timing out. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Match the onPointerDown guard — disabled sliders should let events propagate so parent gesture coordinators and activity tracking work. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
stopPropagation()before the early return guard in the slider'sonPointerUphandler so pointer events always stop propagating to parent gesture coordinators, even when no pointer was captured[data-interactive]toINTERACTIVE_SELECTORso any element can opt into gesture filtering via a data attribute — workaround for React's syntheticstopPropagationnot blocking native events in timeTest plan
pnpm typecheckpassespnpm testpasses🤖 Generated with Claude Code
Note
Medium Risk
Changes pointer-event propagation and gesture filtering around sliders, which can subtly affect click/tap behavior across players. Risk is moderate due to cross-cutting input/gesture handling, but the logic change is small and covered by new e2e tests.
Overview
Prevents slider taps/clicks from leaking to parent gesture coordinators by ensuring the slider’s
onPointerUpalways callsstopPropagation()(even when no pointer capture occurred) and by bailing early when disabled.Extends gesture-interactive filtering to allow any element to opt-in via
[data-interactive], and adds Playwright coverage (HTML and React players) asserting slider clicks seek without triggering container tap gestures.Reviewed by Cursor Bugbot for commit 65bb36b. Bugbot is set up for automated code reviews on this repo. Configure here.