mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-14 20:21:26 +08:00
This modifies the behavious when pasting into the to, cc or bcc fields of a new draft. Any text already in the input field is not automatically deleted. Rather the pasted text is added to the already existing text. If the new contents of the email field now matches as an email address (based on RegExpUtils.emailRegex().test()), then the address is immediately tokenized. If the new input text doesn't match as an email, just append the new text and wait for further input.
This commit is contained in:
parent
eebc6c5c9b
commit
1392887c83
1 changed files with 7 additions and 2 deletions
|
@ -528,8 +528,13 @@ class TokenizingTextField extends React.Component
|
|||
|
||||
_onPaste: (event) =>
|
||||
data = event.clipboardData.getData('text/plain')
|
||||
@_addInputValue(data)
|
||||
event.preventDefault()
|
||||
newInputValue = @state.inputValue + data
|
||||
if RegExpUtils.emailRegex().test(newInputValue)
|
||||
@_addInputValue(newInputValue, skipNameLookup: true)
|
||||
event.preventDefault()
|
||||
else
|
||||
@_refreshCompletions(newInputValue)
|
||||
|
||||
|
||||
# Managing Suggestions
|
||||
|
||||
|
|
Loading…
Reference in a new issue