Bug 1580450 - Move tab focus to the origin input when no logins are present and the 'create' mode is entered. r=MattN
authorJared Wein <jwein@mozilla.com>
Tue, 17 Sep 2019 14:02:22 +0000
changeset 555198 35bba585d13f15c90eb1c15b82accd37d9383847
parent 555197 fc8e6568f698c88ffc505fc42df0e125aea68d77
child 555199 718f2ddc38e0f5214b4db2184595168b108c30b3
push id2165
push userffxbld-merge
push dateMon, 14 Oct 2019 16:30:58 +0000
treeherdermozilla-release@0eae18af659f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMattN
bugs1580450
milestone70.0
Bug 1580450 - Move tab focus to the origin input when no logins are present and the 'create' mode is entered. r=MattN Differential Revision: https://phabricator.services.mozilla.com/D45889
browser/components/aboutlogins/content/components/login-list.js
--- a/browser/components/aboutlogins/content/components/login-list.js
+++ b/browser/components/aboutlogins/content/components/login-list.js
@@ -432,17 +432,20 @@ export default class LoginList extends H
     ) {
       // Bug 1562716: Pressing Tab from the create-login-button cycles back to the
       // login-sort dropdown due to the login-list having `overflow`
       // CSS property set. Explicitly forward focus here until
       // this keyboard trap is fixed.
       if (event.shiftKey) {
         return;
       }
-      if (this.classList.contains("no-logins")) {
+      if (
+        this.classList.contains("no-logins") &&
+        !this.classList.contains("create-login-selected")
+      ) {
         let loginIntro = document.querySelector("login-intro");
         event.preventDefault();
         loginIntro.focus();
         return;
       }
       let loginItem = document.querySelector("login-item");
       if (loginItem) {
         event.preventDefault();