Bug 1342297 - Fix inplace-editor autocomplete. r=jdescottes draft
authorTim Nguyen <ntim.bugs@gmail.com>
Sat, 25 Feb 2017 13:14:38 +0000
changeset 489665 410c046949afc77173c3c3edf3dc8bf32b6b1b41
parent 489664 cc410cd568de56d9453e68a9642b23b91d323998
child 547052 a155a78619426fd30fd29ee6fcdd69a0c3d48de3
push id46875
push userbmo:ntim.bugs@gmail.com
push dateSat, 25 Feb 2017 13:15:07 +0000
reviewersjdescottes
bugs1342297
milestone54.0a1
Bug 1342297 - Fix inplace-editor autocomplete. r=jdescottes MozReview-Commit-ID: KpimIPfqz4o
devtools/client/shared/inplace-editor.js
--- a/devtools/client/shared/inplace-editor.js
+++ b/devtools/client/shared/inplace-editor.js
@@ -1150,27 +1150,31 @@ InplaceEditor.prototype = {
       // Close the popup if open
       if (this.popup && this.popup.isOpen) {
         this._hideAutocompletePopup();
       }
       prevent = true;
       this.cancelled = true;
       this._apply();
       this._clear();
-      event.stopPropagation();
     } else if (isKeyIn(key, "SPACE")) {
       // No need for leading spaces here.  This is particularly
       // noticable when adding a property: it's very natural to type
       // <name>: (which advances to the next property) then spacebar.
       prevent = !input.value;
     }
 
     if (prevent) {
       event.preventDefault();
     }
+
+    // We don't want to propagate this keypress event to the parent
+    // frame (toolbox), since it seems to break the text selection feature
+    // of autocomplete.
+    event.stopPropagation();
   },
 
   _onContextMenu: function (event) {
     if (this.contextMenu) {
       this.contextMenu(event);
     }
   },