Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/roundcube/roundcubemail.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/skins
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2019-07-17 19:35:46 +0300
committerAleksander Machniak <alec@alec.pl>2019-07-17 19:35:46 +0300
commit5baa8981eaace97dadc4705d2687630c33225a25 (patch)
treed4b95517d7e007a4d0b944f6a2e209a8c2b3aea8 /skins
parent7a854f1b56288c695e9406af8558bad6458c9385 (diff)
Elastic: Fix bug in handling pasting text into a recipient input
Diffstat (limited to 'skins')
-rw-r--r--skins/elastic/ui.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/skins/elastic/ui.js b/skins/elastic/ui.js
index ad41643c8..d29e30494 100644
--- a/skins/elastic/ui.js
+++ b/skins/elastic/ui.js
@@ -3120,9 +3120,18 @@ function rcube_elastic_ui()
return result.recipients.length > 0;
},
parse_func = function(e) {
+ var paste, value = this.value;
+
// 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)
- update_func(e.type == 'paste' ? (e.originalEvent.clipboardData || window.clipboardData).getData('text') : this.value);
+ if (e.type == 'paste') {
+ // pasted text
+ paste = (e.originalEvent.clipboardData || window.clipboardData).getData('text') || '';
+ // insert pasted text in place of the selection (or just cursor position)
+ value = value.substring(0, this.selectionStart) + paste + value.substring(this.selectionEnd);
+ }
+
+ update_func(value);
},
keydown_func = function(e) {
// On Backspace remove the last recipient