-
Notifications
You must be signed in to change notification settings - Fork 116
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: Add tabindex to preview container #858
Conversation
Verified that @ConradJChan has signed the CLA. Thanks for the pull request! |
src/lib/Fullscreen.js
Outdated
if (el) { | ||
// If el has target property, then it is an Event | ||
// otherwise it is a HTMLElement | ||
const element = el.target || el; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I initially wrote this checking to see if el instanceof Event
but couldn't figure out a good way to unit test it so settled on this. Open to suggestions
* @param {HTMLElement|Event} el - Fullscreen element or event | ||
* @return {void} | ||
*/ | ||
focusFullscreenElement = (el) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like it is pretty generic, maybe add to util.js?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is and it isn't, taking either a HTMLElement or Event and extracting out the HTMLElement to focus on seems a bit specific to this logic, maybe if this situation comes up again in another file we can move it then
No description provided.