[Rt-commit] rt branch, 4.4-trunk, updated. rt-4.4.4-256-g591579de08

? sunnavy sunnavy at bestpractical.com
Fri Mar 5 15:12:30 EST 2021


The branch, 4.4-trunk has been updated
       via  591579de086cdb279dcb9723e3c51fd0a6f0bdf7 (commit)
       via  dcd3ee96f6847d7e9f48bbdc0720d69d30e4ed41 (commit)
      from  6fc6be9791f5d7fe6a7ed5c10aa98de8a5a4631f (commit)

Summary of changes:
 share/static/js/util.js | 12 ++++++++++++
 1 file changed, 12 insertions(+)

- Log -----------------------------------------------------------------
commit dcd3ee96f6847d7e9f48bbdc0720d69d30e4ed41
Author: Blaine Motsinger <blaine at bestpractical.com>
Date:   Mon Aug 31 16:30:29 2020 -0500

    Disable submit on enter when input's autocomplete list shows up
    
    When autocomplete list shows up, shall "enter" select the first
    candidate in the list or submit the form, either choice has pros and
    cons. This commit chooses to do nothing to avoid the confusion.
    
    Fixes: I#32632

diff --git a/share/static/js/util.js b/share/static/js/util.js
index d5bf84562a..d791e1284d 100644
--- a/share/static/js/util.js
+++ b/share/static/js/util.js
@@ -527,6 +527,18 @@ function addprincipal_onchange(ev, ui) {
     }
 }
 
+// disable submit on enter in autocomplete boxes
+jQuery(function() {
+    jQuery('input[data-autocomplete], input.ui-autocomplete-input').each(function() {
+        var input = jQuery(this);
+
+        input.on('keypress', function(event) {
+            if (event.keyCode === 13 && jQuery('ul.ui-autocomplete').is(':visible')) {
+                return false;
+            }
+        });
+    });
+});
 
 function escapeCssSelector(str) {
     return str.replace(/([^A-Za-z0-9_-])/g,'\\$1');

commit 591579de086cdb279dcb9723e3c51fd0a6f0bdf7
Merge: 6fc6be9791 dcd3ee96f6
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Sat Mar 6 03:13:16 2021 +0800

    Merge branch '4.4/disable-submit-on-enter-in-autocomplete' into 4.4-trunk


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


More information about the rt-commit mailing list