diff --git 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 index 863eab193387..5139d1788a37 100644 --- 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 @@ -43,6 +43,19 @@ var testData = [ ["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], diff --git a/devtools/client/shared/inplace-editor.js b/devtools/client/shared/inplace-editor.js index 5d9b95f8dc22..93ea1278c87e 100644 --- a/devtools/client/shared/inplace-editor.js +++ b/devtools/client/shared/inplace-editor.js @@ -1050,7 +1050,7 @@ InplaceEditor.prototype = { increment = this._getIncrement(event); } - if (isKeyIn(key, "HOME", "END", "PAGE_UP", "PAGE_DOWN")) { + if (isKeyIn(key, "PAGE_UP", "PAGE_DOWN")) { this._preventSuggestions = true; } @@ -1068,7 +1068,7 @@ InplaceEditor.prototype = { this._doValidation(); } - if (isKeyIn(key, "BACK_SPACE", "DELETE", "LEFT", "RIGHT")) { + if (isKeyIn(key, "BACK_SPACE", "DELETE", "LEFT", "RIGHT", "HOME", "END")) { if (isPopupOpen) { this._hideAutocompletePopup(); }