Bug 1178967 - Collapse autocomplete popup when pressing Home/En. r=jdescottes

MozReview-Commit-ID: GqF75PItgf5

--HG--
extra : transplant_source : %9ECq%12%A5%1B%C0%0AG/%B9e%BF%9C%B1%F6%23%10%B4%E7
This commit is contained in:
Ricky Chien 2016-05-24 18:33:00 +08:00
Родитель 58ea403ab2
Коммит 970e9b8288
2 изменённых файлов: 15 добавлений и 2 удалений

Просмотреть файл

@ -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],

Просмотреть файл

@ -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();
}