fix: only change focus from BPB if not tap or mouse click#9015
fix: only change focus from BPB if not tap or mouse click#9015Essk merged 2 commits intovideojs:mainfrom
Conversation
|
💖 Thanks for opening this pull request! 💖 Things that will help get your PR across the finish line:
We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9015 +/- ##
==========================================
- Coverage 84.34% 84.31% -0.04%
==========================================
Files 120 120
Lines 8152 8152
Branches 1964 1964
==========================================
- Hits 6876 6873 -3
- Misses 1276 1279 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Congrats on merging your first pull request! 🎉🎉🎉 |
|
@Frenzie and @mister-ben - where does focus go when the big play button is activated, if it doesn't move to the play/pause button in the control bar? For accessibility, it can't be left in an indeterminate state, and since the BPB is hidden when it is activated, moving focus to the other play/pause button made the most sense. I'm not clear what the expected outcome of this fix is if the user clicks or taps the BPB, but this idea of not moving focus to a control has been used in media players in the past as a workaround for the focus outline appearing on a control when some designers don't like the focus outline. If that's what this fix is trying to achieve, then it would be much better (and more accessible) to adopt the :focus-visible approach, so that focus does move to the play/pause button but the focus outline is only shown if it is needed (by users who are using a mouse or touch). See also the https://github.com/videojs/video.js/blob/main/sandbox/noUITitleAttributes.html.example example I created 4 years ago, back when focus-visible was polyfilled. |
|
Focus shifts to the video element. |
References #9006. Minor extension of #4497.
Specific Changes proposed
Don't set focus after tapping on the big play button
Requirements Checklist
IE)npm run docs:apito error