mirror of
https://github.com/mjl-/mox.git
synced 2025-07-10 09:14:39 +03:00
Split paste into addr field by commas
This commit is contained in:
@ -2862,6 +2862,23 @@ const compose = (opts, listMailboxes) => {
|
||||
}, function change() {
|
||||
autosizeElem.dataset.value = inputElem.value;
|
||||
fetchRecipientSecurity();
|
||||
}, function paste(e) {
|
||||
const data = e.clipboardData?.getData('text/plain');
|
||||
if (typeof data !== 'string' || data === '') {
|
||||
return;
|
||||
}
|
||||
const split = data.split(',');
|
||||
if (split.length <= 1) {
|
||||
return;
|
||||
}
|
||||
autosizeElem.dataset.value = inputElem.value = split[0];
|
||||
let last;
|
||||
for (const rest of split.splice(1)) {
|
||||
last = newAddrView(rest.trim(), isRecipient, views, btn, cell, row, single);
|
||||
}
|
||||
last.input.focus();
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
}), securityBar = dom.span(css('securitybar', {
|
||||
margin: '0 1px',
|
||||
borderBottom: '1.5px solid',
|
||||
|
Reference in New Issue
Block a user