-
Notifications
You must be signed in to change notification settings - Fork 29.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
Trusted domain dialog in web doesn't return focus to previously clicked element when canceled. #170442
Comments
Discovered by the accessibility testing team in microsoft/vscode-pull-request-github#4242 |
GitHubTags:#A11ySev3;#A11yTCS;#A11yMAS;#DesktopWeb;#Visual Studio Code Client;#WCAG2.4.3;#BM-VisualStudioCode-Win32-Nov2021; primary bug:microsoft/vscode-pull-request-github#4242 |
@alexr00 I'm not sure what I can do on my side. The custom dialog takes the active element before showing and restores it after the dialog is dismissed. In this case, the active element is the iframe for the webview. I think the webview content provider may need to hand focus coming back to the iframe and decide if it should restore focus to the previously active element. |
@sbatten I assumed that it was fixable by the custom dialog since the issue doesn't happen with the native dialog (and since it is something that will affect all extensions with webviews). Does this need to be fixed by individual extensions? |
The native dialog doesn't have this issue because it doesn't truly steal focus, its a separate window. In custom dialogs we try our best to restore focus to mimic the behaviour of a native dialog but since the focused element is inside a webview, we need a webview specific solution. After chatting with @mjbvz we propose that the PR extension handle this when the iframe is refocused. I'm not sure if the PR extension keeps some internal focus state to handle tab navigation. However, if there is a general webview solution, we can pull that up. At the dialog level it is impossible for me to properly restore focus to a specific element inside the iframe unfortunately. |
Thanks for starting this discussion, and a friendly reminder that we have to tackle this in April for compliance reasons. @scottaohara what do you think? Somewhat similar to our previous webview focus discussion? If the custom dialog returns the focus to the WebView (outer element) would that be enough to reduce severity to 3? Otherwise VS Code can not pass focus back to the exact element as @sbatten explained above. |
We are already passing focus back to the outer webview at the dialog layer. |
Thanks. Let's see what @scottaohara says. |
i imagine that'll be the best you can do, assuming these would be cross-origin iframes.... moving focus to the iframe of the webview and then letting the extension teams reset focus back to the last focusable element once focus is re-detected back in the iframe. based on the linked issue, as long as that is a common representation of this issue, it does seem like it'd be fine as a sev3, so long as focus was moved back to the iframe/iframe's container, and not to the browser chrome. |
I've verified that focus does return to the iframe, but sometimes tabbing from the iframe takes me to the browser chrome. It actually appears to exactly alternate:
@mjbvz do you know why tabbing from the outer iframe might do this? |
@mjbvz do you have any idea why that might be the case? |
@isidorn @scottaohara how do we get this bumped down to sev3 as discussed? |
@fsteffi should be able to help here. |
hi @sbatten severity has been reduced |
This can be trivially reproduced with the GitHub Pull Requests and Issues extension:
"workbench.trustedDomains.promptInTrustedWorkspace": true
The text was updated successfully, but these errors were encountered: