[Rt-commit] rt branch, 4.4/ticket-enter-submit, created. rt-4.4.1-323-gff398b2

Shawn Moore shawn at bestpractical.com
Fri Mar 17 15:47:05 EDT 2017


The branch, 4.4/ticket-enter-submit has been created
        at  ff398b2fb7e253860e3441f9e6b49a87d0fc509d (commit)

- Log -----------------------------------------------------------------
commit ff398b2fb7e253860e3441f9e6b49a87d0fc509d
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Fri Mar 17 15:45:48 2017 -0400

    Suppress enter-keystroke form submission behavior on ticket create/reply
    
    This is too easy to trigger accidentally, especially when navigating
    autocomplete results.
    
    Fixes: I#32632

diff --git a/share/static/js/util.js b/share/static/js/util.js
index eda0127..cb30a33 100644
--- a/share/static/js/util.js
+++ b/share/static/js/util.js
@@ -559,6 +559,15 @@ jQuery(function() {
         }, 'json');
         return false;
     });
+
+    jQuery('form[name=TicketCreate], form[name=TicketUpdate]').keypress(function (e) {
+        if (jQuery(e.target).is('textarea')) {
+            return true;
+        }
+        if (e.keyCode == 13) {
+            return false;
+        }
+    });
 });
 
 // focus jquery object in window, only moving the screen when necessary

-----------------------------------------------------------------------


More information about the rt-commit mailing list