-
Notifications
You must be signed in to change notification settings - Fork 7k
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(FocusLock): Stop stealing focus when embedded #9229
Conversation
Hey, @skolmer could you PTAL at this too? I'm undoing a change (see screenshot) that was part of your Atlaskit overhaul a while back as it ended up not working as expected, namely focus is still being stolen when the conference is embedded and dialogs are rendered. I'm not sure if this messes something else up, so please let me know. I also didn't find the |
Hi @muscat1, I might have missed an edgecase here. The expected behavior is: If modal dialogs are shown the focus should move to the dialog. Locking focus to dialogs is a requirement to achieve WCAG 2 compliance. Can you give an example where this causes issues? It should only be active for modal dialogs that are opened by a user action not for alerts or other stuff that are triggered without user input. So when it triggers the user focus should already be inside of jitsi and not the outer frame. You are right it is not well documented. You can read about it in this PR theKashey/react-focus-lock#104 |
To ensure that focus-lock is only active when the jtsi frame has focus we could use https://developer.mozilla.org/en-US/docs/Web/API/Document/hasFocus to check if the document has focus and otherwise disable focus-lock. |
Thanks for the quick reply @skolmer. I drew up a quick example here: https://jsbin.com/lizoguqiru/edit?html,output |
Also, thanks for pointing out the actual feature. From what it states, it should be enough for our use case, but by running a quick |
oh, that might explain it. I added the newest version to the package.json but can't find it in the current master nor in the PR we provided. It might have got lost on the way, sorry for that 🤦♂️ |
cd19e89
to
757b340
Compare
Seems to have done the trick, thanks for taking the time to look into it! I had to convert the wrapper to a function component (which I like, anyway) since |
757b340
to
460473c
Compare
No description provided.