sampotts / plyr

A simple HTML5, YouTube and Vimeo player
https://plyr.io
MIT License
26.39k stars 2.92k forks source link

Focus Trap When Exiting Fullscreen #1665

Closed justinbansal closed 4 years ago

justinbansal commented 4 years ago

Expected behaviour

When using the keyboard and exiting fullscreen, the expected behaviour is for you to be able to tab forward to the next element. This ends up being the video wrapper usually.

Actual behaviour

Upon exiting fullscreen, you are stuck in a focus trap. I can't tab forward. If the video is playing, it is stuck here but if video stops, then it will tab forward but instead of going to the wrapper element next, it goes to the play button icon. From this point a tab forward goes to the play/pause button and through all the controls again. It just keeps cycling through this.

Steps to reproduce

Tab through player (mine is within a Flickity slider), hit enter on fullscreen, hit escape to exit, then try to tab forward.

Environment

Console errors (if any)

Link to where the bug is happening

sampotts commented 4 years ago

This should be resolved in v3.5.7. I've used your PR but also fixed the root issue and moved the focus trap logic over to the fullscreen class.