Skip to content

fix: handle Mac trackpad tap-to-click in isSingleLeftClick#9177

Open
okxint wants to merge 1 commit into
videojs:mainfrom
okxint:fix/trackpad-single-left-click
Open

fix: handle Mac trackpad tap-to-click in isSingleLeftClick#9177
okxint wants to merge 1 commit into
videojs:mainfrom
okxint:fix/trackpad-single-left-click

Conversation

@okxint
Copy link
Copy Markdown

@okxint okxint commented May 6, 2026

Summary

Fixes #7736.

Mac trackpad tap-to-click fires mousedown with {button: 0, buttons: 0} instead of the expected {button: 0, buttons: 1}. The current isSingleLeftClick has separate blocks for mouseup and mousedown handling this {0, 0} case — this PR consolidates them into a single event.type !== 'mousemove' guard.

The {0, 0} rejection is only meaningful for mousemove events (detecting button release during a drag). For all other event types (mousedown, mouseup, etc.), {button: 0, buttons: 0} is a valid single left click.

This approach was suggested by @gkatsev in #7736 (comment).

Changes

  • src/js/utils/dom.js: Replace event.type === 'mouseup' with event.type !== 'mousemove' for the {0, 0} check, removing the separate mousedown block

Test plan

  • Existing tests cover all three event types: mousemove {0,0} → false, mouseup {0,0} → true, mousedown {0,0} → true
  • Manual verification on Mac with tap-to-click enabled — seek bar and volume slider respond on first tap

)

Mac trackpad tap-to-click fires mousedown with {button:0, buttons:0}.
Consolidate the mouseup and mousedown {0,0} checks into a single
`event.type !== 'mousemove'` guard — the only event type where {0,0}
should be rejected is mousemove, which signals button release during
a drag.

Closes videojs#7736
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.

Missing case in Dom.isSingleLeftClick

1 participant