Bug 1542099 - Return a11y focus to the input when arrow left/arrow right/home/end keys are pressed. r=Standard8
authorDão Gottwald <dao@mozilla.com>
Fri, 05 Apr 2019 15:00:36 +0000
changeset 526993 4058cdcc2f179e34a5bc6e24044a31f122e2fdff
parent 526992 2e8a7fee489774e1a4f3b1feb5801c232396f6be
child 526994 648001848ed20a1070bcd8844e853491ec764af4
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersStandard8
bugs1542099
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1542099 - Return a11y focus to the input when arrow left/arrow right/home/end keys are pressed. r=Standard8 Differential Revision: https://phabricator.services.mozilla.com/D26313
browser/components/urlbar/UrlbarController.jsm
--- a/browser/components/urlbar/UrlbarController.jsm
+++ b/browser/components/urlbar/UrlbarController.jsm
@@ -300,16 +300,22 @@ class UrlbarController {
         } else {
           if (this.keyEventMovesCaret(event)) {
             break;
           }
           this.input.startQuery();
         }
         event.preventDefault();
         break;
+      case KeyEvent.DOM_VK_LEFT:
+      case KeyEvent.DOM_VK_RIGHT:
+      case KeyEvent.DOM_VK_HOME:
+      case KeyEvent.DOM_VK_END:
+        this.view.removeAccessibleFocus();
+        break;
       case KeyEvent.DOM_VK_DELETE:
       case KeyEvent.DOM_VK_BACK_SPACE:
         if (event.shiftKey && this.view.isOpen && this._handleDeleteEntry()) {
           event.preventDefault();
         }
         break;
     }
   }