diff options
author | Aleksander Machniak <alec@alec.pl> | 2019-07-17 20:03:22 +0300 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2019-07-17 20:03:22 +0300 |
commit | fbe36c7f5a3379a31b553e7c85a24e779440e9d3 (patch) | |
tree | 8da3fda1bbe04e37585ebad9569f57e4405400ad /skins | |
parent | 5baa8981eaace97dadc4705d2687630c33225a25 (diff) |
Elastic: Fix bug where use of Tab key on autocomplete causes double insertion into a recipient input (#6850)
Diffstat (limited to 'skins')
-rw-r--r-- | skins/elastic/ui.js | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/skins/elastic/ui.js b/skins/elastic/ui.js index d29e30494..401d52b71 100644 --- a/skins/elastic/ui.js +++ b/skins/elastic/ui.js @@ -3109,13 +3109,9 @@ function rcube_elastic_ui() insert_recipient(this.name, this.email); }); - // setTimeout() here is needed for proper input reset on paste event - // This is also the reason why we need parse_lock - setTimeout(function() { - input.val(result.text); - apply_func(); - input_len_update(); - }, 1); + input.val(result.text); + apply_func(); + input_len_update(); return result.recipients.length > 0; }, @@ -3129,6 +3125,7 @@ function rcube_elastic_ui() 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); + e.preventDefault(); } update_func(value); |