aboutsummaryrefslogtreecommitdiffstats
path: root/apps/comments/js/commentstabview.js
diff options
context:
space:
mode:
Diffstat (limited to 'apps/comments/js/commentstabview.js')
-rw-r--r--apps/comments/js/commentstabview.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/apps/comments/js/commentstabview.js b/apps/comments/js/commentstabview.js
index 0d752877b04..2ab6349d98a 100644
--- a/apps/comments/js/commentstabview.js
+++ b/apps/comments/js/commentstabview.js
@@ -517,8 +517,11 @@
$field.toggleClass('error', limitExceeded);
$submitButton.prop('disabled', limitExceeded);
- // Submits form with Enter, but Shift+Enter is a new line
- if (ev.keyCode === 13 && !ev.shiftKey) {
+ // Submits form with Enter, but Shift+Enter is a new line. If the
+ // autocomplete popover is being shown Enter does not submit the
+ // form either; it will be handled by At.js which will add the
+ // currently selected item to the message.
+ if (ev.keyCode === 13 && !ev.shiftKey && !$field.atwho('isSelecting')) {
$submitButton.click();
ev.preventDefault();
}