Elastic: Fix recipient input bug when using click to select a contact from autocomplete list (#7231)

bnet/additions
Aleksander Machniak 5 years ago
parent 1c5f83d41c
commit 81e55f8033

@ -4,6 +4,7 @@ CHANGELOG Roundcube Webmail
- Fix bug where attachments with Content-Id were attached to the message on reply (#7122) - Fix bug where attachments with Content-Id were attached to the message on reply (#7122)
- Fix identity selection on reply when both sender and recipient addresses are included in identities (#7211) - Fix identity selection on reply when both sender and recipient addresses are included in identities (#7211)
- Elastic: Fix text selection with Shift+PageUp and Shift+PageDown in plain text editor when using Chrome (#7230) - Elastic: Fix text selection with Shift+PageUp and Shift+PageDown in plain text editor when using Chrome (#7230)
- Elastic: Fix recipient input bug when using click to select a contact from autocomplete list (#7231)
RELEASE 1.4.3 RELEASE 1.4.3
------------- -------------

@ -6081,7 +6081,7 @@ function rcube_webmail()
this.set_caret_pos(input, p + to.length); this.set_caret_pos(input, p + to.length);
// run onchange action on the element // run onchange action on the element
$(input).change(); $(input).trigger('change', [true]);
}; };
this.ksearch_click = function(node) this.ksearch_click = function(node)

@ -3173,8 +3173,8 @@ function rcube_elastic_ui()
return result.recipients.length > 0; return result.recipients.length > 0;
}, },
parse_func = function(e) { parse_func = function(e, ac) {
var paste, value = this.value; var last, paste, value = this.value;
// On paste the text is not yet in the input we have to use clipboard. // On paste the text is not yet in the input we have to use clipboard.
// Also because on paste new-line characters are replaced by spaces (#6460) // Also because on paste new-line characters are replaced by spaces (#6460)
@ -3185,6 +3185,16 @@ function rcube_elastic_ui()
value = value.substring(0, this.selectionStart) + paste + value.substring(this.selectionEnd); value = value.substring(0, this.selectionStart) + paste + value.substring(this.selectionEnd);
e.preventDefault(); e.preventDefault();
} }
// #7231: When clicking on autocompletion list a change event
// is fired twice. We have to remove last recipient box if it is
// the same recpient (with incomplete email address).
// FIXME: Anyone with a better solution?
else if (ac) {
last = list.find('li.recipient').last();
if (last.length && this.value.indexOf(last.text().replace(/[ ,]+$/, '')) > -1) {
last.remove();
}
}
update_func(value); update_func(value);
}, },

Loading…
Cancel
Save