mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 987870 - Fix multiple issue of cycling suggesting and pressing keys with modifiers in an empty inplace editor, r=bgrins
This commit is contained in:
parent
2fec4d2709
commit
05e38624da
@ -720,7 +720,8 @@ InplaceEditor.prototype = {
|
|||||||
_cycleCSSSuggestion:
|
_cycleCSSSuggestion:
|
||||||
function InplaceEditor_cycleCSSSuggestion(aReverse, aNoSelect)
|
function InplaceEditor_cycleCSSSuggestion(aReverse, aNoSelect)
|
||||||
{
|
{
|
||||||
let {label, preLabel} = this.popup.selectedItem;
|
// selectedItem can be null when nothing is selected in an empty editor.
|
||||||
|
let {label, preLabel} = this.popup.selectedItem || {label: "", preLabel: ""};
|
||||||
if (aReverse) {
|
if (aReverse) {
|
||||||
this.popup.selectPreviousItem();
|
this.popup.selectPreviousItem();
|
||||||
} else {
|
} else {
|
||||||
@ -872,7 +873,7 @@ InplaceEditor.prototype = {
|
|||||||
if (this.popup && this.popup.isOpen) {
|
if (this.popup && this.popup.isOpen) {
|
||||||
this.popup.hidePopup();
|
this.popup.hidePopup();
|
||||||
}
|
}
|
||||||
} else if (!cycling) {
|
} else if (!cycling && !aEvent.metaKey && !aEvent.altKey && !aEvent.ctrlKey) {
|
||||||
this._maybeSuggestCompletion();
|
this._maybeSuggestCompletion();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,9 +21,11 @@ let brace;
|
|||||||
// total items in the popup
|
// total items in the popup
|
||||||
// ]
|
// ]
|
||||||
let testData = [
|
let testData = [
|
||||||
|
["a", {accelKey: true, ctrlKey: true}, "", -1, 0],
|
||||||
["d", {}, "direction", 0, 3],
|
["d", {}, "direction", 0, 3],
|
||||||
["VK_DOWN", {}, "display", 1, 3],
|
["VK_DOWN", {}, "display", 1, 3],
|
||||||
["VK_TAB", {}, "", -1, 10],
|
["VK_TAB", {}, "", -1, 10],
|
||||||
|
["VK_DOWN", {}, "-moz-box", 0, 10],
|
||||||
["n", {}, "none", -1, 0],
|
["n", {}, "none", -1, 0],
|
||||||
["VK_TAB", {shiftKey: true}, "display", -1, 0],
|
["VK_TAB", {shiftKey: true}, "display", -1, 0],
|
||||||
["VK_BACK_SPACE", {}, "", -1, 0],
|
["VK_BACK_SPACE", {}, "", -1, 0],
|
||||||
@ -85,7 +87,8 @@ function checkStateAndMoveOn(index) {
|
|||||||
checkState();
|
checkState();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else if (/(right|back_space|escape|return)/ig.test(key)) {
|
else if (/(right|back_space|escape|return)/ig.test(key) ||
|
||||||
|
(modifiers.accelKey || modifiers.ctrlKey)) {
|
||||||
info("added event listener for right|escape|back_space|return keys");
|
info("added event listener for right|escape|back_space|return keys");
|
||||||
editor.input.addEventListener("keypress", function onKeypress() {
|
editor.input.addEventListener("keypress", function onKeypress() {
|
||||||
if (editor.input) {
|
if (editor.input) {
|
||||||
|
Loading…
Reference in New Issue
Block a user