--- a/devtools/client/inspector/rules/test/browser_rules_completion-existing-property_01.js
+++ b/devtools/client/inspector/rules/test/browser_rules_completion-existing-property_01.js
@@ -38,16 +38,29 @@ var testData = [
["VK_BACK_SPACE", "dis", -1, 0],
["VK_BACK_SPACE", "di", -1, 0],
["VK_BACK_SPACE", "d", -1, 0],
["VK_BACK_SPACE", "", -1, 0],
["VK_HOME", "", -1, 0],
["VK_END", "", -1, 0],
["VK_PAGE_UP", "", -1, 0],
["VK_PAGE_DOWN", "", -1, 0],
+ ["d", "display", 1, 3],
+ ["VK_HOME", "display", -1, 0],
+ ["VK_END", "display", -1, 0],
+ // Press right key to ensure caret move to end of the input on Mac OS since
+ // Mac OS doesn't move caret after pressing HOME / END.
+ ["VK_RIGHT", "display", -1, 0],
+ ["VK_BACK_SPACE", "displa", -1, 0],
+ ["VK_BACK_SPACE", "displ", -1, 0],
+ ["VK_BACK_SPACE", "disp", -1, 0],
+ ["VK_BACK_SPACE", "dis", -1, 0],
+ ["VK_BACK_SPACE", "di", -1, 0],
+ ["VK_BACK_SPACE", "d", -1, 0],
+ ["VK_BACK_SPACE", "", -1, 0],
["f", "font-size", 19, 32],
["i", "filter", 3, 4],
["VK_LEFT", "filter", -1, 0],
["VK_LEFT", "filter", -1, 0],
["i", "fiilter", -1, 0],
["VK_ESCAPE", null, -1, 0],
];
--- a/devtools/client/shared/inplace-editor.js
+++ b/devtools/client/shared/inplace-editor.js
@@ -1045,17 +1045,17 @@ InplaceEditor.prototype = {
let isPlainText = this.contentType == CONTENT_TYPES.PLAIN_TEXT;
let isPopupOpen = this.popup && this.popup.isOpen;
let increment = 0;
if (!isPlainText && !multilineNavigation) {
increment = this._getIncrement(event);
}
- if (isKeyIn(key, "HOME", "END", "PAGE_UP", "PAGE_DOWN")) {
+ if (isKeyIn(key, "PAGE_UP", "PAGE_DOWN")) {
this._preventSuggestions = true;
}
let cycling = false;
if (increment && this._incrementValue(increment)) {
this._updateSize();
prevent = true;
cycling = true;
@@ -1063,17 +1063,17 @@ InplaceEditor.prototype = {
if (isPopupOpen && isKeyIn(key, "UP", "DOWN", "PAGE_UP", "PAGE_DOWN")) {
prevent = true;
cycling = true;
this._cycleCSSSuggestion(isKeyIn(key, "UP", "PAGE_UP"));
this._doValidation();
}
- if (isKeyIn(key, "BACK_SPACE", "DELETE", "LEFT", "RIGHT")) {
+ if (isKeyIn(key, "BACK_SPACE", "DELETE", "LEFT", "RIGHT", "HOME", "END")) {
if (isPopupOpen) {
this._hideAutocompletePopup();
}
} else if (!cycling && !multilineNavigation &&
!event.metaKey && !event.altKey && !event.ctrlKey) {
this._maybeSuggestCompletion(true);
}