Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Support MacOS trackpad with tap-to-click #8700

Merged
merged 1 commit into from
Apr 25, 2024

Conversation

mister-ben
Copy link
Contributor

@mister-ben mister-ben commented Apr 19, 2024

Description

If a MacOS trackpad is using "tap to click", the tap/click was being ignored by the seek bar sometimes, so there would be no seek. This is because the mousedown MouseEvent has {button: 0, buttons: 0} or {button: 0, buttons: 1} inconsistently.

Specific Changes proposed

  • Adds a case in utils/dom to consider (event.type === 'mousedown' && event.button === 0 && event.buttons === 0) a click.
  • Removes a conflicting test. That is covered by the test above it for the mousemove event.

Fixes #8691, #7736

Requirements Checklist

  • Feature implemented / Bug fixed
  • If necessary, more likely in a feature request than a bug fix
    • Change has been verified in an actual browser (Chrome, Firefox, IE)
    • Unit Tests updated or fixed
    • Docs/guides updated
    • Example created (starter template on JSBin)
  • Reviewed by Two Core Contributors

Copy link

codecov bot commented Apr 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.62%. Comparing base (ec69d5e) to head (77fe511).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8700      +/-   ##
==========================================
+ Coverage   83.00%   83.62%   +0.61%     
==========================================
  Files         120      120              
  Lines        7996     7998       +2     
  Branches     1926     1927       +1     
==========================================
+ Hits         6637     6688      +51     
+ Misses       1359     1310      -49     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@gkatsev
Copy link
Member

gkatsev commented Apr 20, 2024

Just wanted to note that on my laptop with 14.2.1 sonoma, I get button=0 and buttons=1. Going to update it and see if it changes.

@gkatsev
Copy link
Member

gkatsev commented Apr 20, 2024

Upgrading the macos didn't change the behavior. Setting up logging in the method, 95% of the time it does 0,1, but sometimes it is 0,0.

@mister-ben mister-ben merged commit cb76a24 into videojs:main Apr 25, 2024
12 checks passed
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.

Tap to click not work not progressbar
2 participants