Bug 1580950 - Make click onto auto-complete results popup accept suggestion and move to the next line again. r=jorgk DONTBUILD

This commit is contained in:
Alessandro Castellani ext:(%20and%20aceman%20%3Cacelists%40atlas.sk%3E) 2019-09-14 00:00:02 +02:00
Родитель 07245793c7
Коммит 3a81dcb150
5 изменённых файлов: 21 добавлений и 13 удалений

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

@ -74,7 +74,7 @@
minresultsforpopup="3"
onkeypress="awAbRecipientKeyPress(event, this);"
onkeydown="awRecipientKeyDown(event, this);"
onclick="awNotAnEmptyArea(event);"/>
onclick="onRecipientClicked(event, this);"/>
</hbox>
</richlistitem>
</richlistbox>

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

@ -87,7 +87,7 @@
minresultsforpopup="3"
onkeypress="awAbRecipientKeyPress(event, this);"
onkeydown="awRecipientKeyDown(event, this);"
onclick="awNotAnEmptyArea(event);"/>
onclick="onRecipientClicked(event, this);"/>
</hbox>
</richlistitem>
</richlistbox>

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

@ -907,6 +907,24 @@ function awRecipientOnFocus(inputElement) {
inputElement.select();
}
function onRecipientClicked(event, inputElement) {
// If the clicked element has a "panel" somewhere in its ancestors, it was
// inside the auto-complete results popup and we want to advance to next row.
let targetNode = event.originalTarget;
while (targetNode) {
if (targetNode.id.startsWith("addressCol")) {
// We're not on the auto-complete popup, so return to avoid
// climbing up the hierarchy.
return;
}
if (targetNode.localName == "panel") {
awReturnHit(inputElement);
return;
}
targetNode = targetNode.parentNode;
}
}
/**
* Handles keypress events for the email address inputs (that auto-fill)
* in the Address Book Mailing List dialogs. When a comma-separated list of

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

@ -2053,6 +2053,7 @@
onfocus="awRecipientOnFocus(this);"
onchange="onRecipientsChanged();"
oninput="onRecipientsChanged();"
onclick="onRecipientClicked(event, this);"
onkeypress="awRecipientKeyPress(event, this)"
onkeydown="awRecipientKeyDown(event, this)"
disableonsend="true">

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

@ -340,17 +340,6 @@ function SetInputValue(inputValue, parentNode, templateNode) {
}
}
function awNotAnEmptyArea(event) {
// This is temporary until i figure out how to ensure to always having an empty space after the last row
var lastInput = awGetInputElement(top.MAX_RECIPIENTS);
if (lastInput && lastInput.value) {
awAppendNewRow(false);
}
event.stopPropagation();
}
function awClickEmptySpace(target, setFocus) {
if (target == null || target.localName != "hbox") {
return;