Bug 1294038 - force selections to be read after webconsole completion;r=nchevobbe draft
authorJulian Descottes <jdescottes@mozilla.com>
Mon, 06 Feb 2017 13:59:41 +0100
changeset 479317 2bd7a0f0d6c9208fa5e609e3cdc73acfbfc0bbc4
parent 479141 20a8536b0bfac74389d3a57bd8dd957d98779ce1
child 544656 31b7df850ba690f68714a928290c213fed871f23
push id44221
push userjdescottes@mozilla.com
push dateMon, 06 Feb 2017 14:08:16 +0000
reviewersnchevobbe
bugs1294038
milestone54.0a1
Bug 1294038 - force selections to be read after webconsole completion;r=nchevobbe MozReview-Commit-ID: 977wLMj3cSa
devtools/client/webconsole/jsterm.js
--- a/devtools/client/webconsole/jsterm.js
+++ b/devtools/client/webconsole/jsterm.js
@@ -1632,16 +1632,22 @@ JSTerm.prototype = {
    * Clear the current completion information and close the autocomplete popup,
    * if needed.
    */
   clearCompletion: function () {
     this.autocompletePopup.clearItems();
     this.lastCompletion = { value: null };
     this.updateCompleteNode("");
     if (this.autocompletePopup.isOpen) {
+      // Trigger a blur/focus of the JSTerm input to force screen readers to read the
+      // value again.
+      this.inputNode.blur();
+      this.autocompletePopup.once("popup-closed", () => {
+        this.inputNode.focus();
+      });
       this.autocompletePopup.hidePopup();
       this._autocompletePopupNavigated = false;
     }
   },
 
   /**
    * Accept the proposed input completion.
    *