mirror of
https://github.com/mjl-/mox.git
synced 2025-07-10 07:14:40 +03:00
Split paste into addr field by commas
This commit is contained in:
@ -1785,6 +1785,24 @@ const compose = (opts: ComposeOptions, listMailboxes: listMailboxes) => {
|
||||
autosizeElem.dataset.value = inputElem.value
|
||||
fetchRecipientSecurity()
|
||||
},
|
||||
function paste(e: ClipboardEvent) {
|
||||
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', {
|
||||
|
Reference in New Issue
Block a user