Steps to reproduce
This is similar to Issue #4553802 but involves using the toolbar. Interacting with a toolbar button does not properly restore focus to the content document once the UI for the toolbar button is dismissed.
Steps to reproduce
- Visit the same JSFiddle from Issue #4553802: https://jsfiddle.net/cwa4mz29/
- Click into the result pane in the bottom right quadrant
- Press return
- Dismiss the alert via mouse or keyboard
- Click the Share button in the Edge toolbar.
- Press escape to dismiss the share interface
- Press return
The test alert from the JSFiddle should once again fire.
The share interface displays again.
We discovered this in the process of testing the 1Password extension in Edge. 1Password has a feature called autosubmit where, after filling the user’s credentials, 1Password will simulate a press of the return key. Our extension takes pains to ensure a password field has focus via
querySelector(":focus") before initiating the submit. Edge reports that the password field does still have focus, so the extension instructs the 1Password application to simulate the keystroke, upon which, the 1Password button is activated again causing the 1Password interface to pop up.
This issue is particular to the toolbar button, which we verified by using a few different entry points for 1Password filling. For instance, right clicking in the page and using the context menu to show 1Password allowed us to submit properly after filling. This also disproved our initial hypothesis that the change of application from Edge to 1Password and back contributed to this focus issue.
We have a similar issue with Chrome where when the omnibar can retain focus and refuse to transfer focus to the password element even after the extension calls
.focus() on the element. Unlike Edge, though, Chrome returns
null for the
querySelector call and 1Password properly avoids unexpected behavior.
Comments and activity
- Microsoft Edge Team
Changed Assigned To to “Laura M.”
Changed Status to “By design”
Thank you for providing this information about the issue. When you click a focusable button, focus goes there; when the flyout invokes as part of the press, focus moves to the flyout. When you dismiss the flyout associated with a button using escape, the focus should move back to that originating button. Currently, we do not plan to change this behavior. Please update this case if you can provide new information for us to consider.
The MS Edge Team
@James M. thanks for detailed explanation, however I’d like to bring attention to specific issue:
Edge reports that the password field does still have focus
If for some reason focus stays with button, then at least selector must not report HTML element focused anymore.
@James, this is also inconsistent with how other browsers work.
For an example;
- Go to Facebook.com in Chrome or Firefox
- Type in any open text field, like your first name
- Click to bookmark the site, once you’re done with adding the bookmark, keep typing and it is still does in the name field.
- In Edge, it does not do this when you bookmark the site while typing into Facebook.
I’d like your team to reconsider this because the toolbar is not the primary focus for the users, the site is. When the user is done with the toolbar, it should return the focus to the site, both for the browser actions and for the extensions.