[Rt-commit] rt branch, 4.4/disable-submit-on-enter-in-autocomplete, repushed
Blaine Motsinger
blaine at bestpractical.com
Wed Feb 3 20:49:49 EST 2021
The branch 4.4/disable-submit-on-enter-in-autocomplete was deleted and repushed:
was c746c190ecfbc8d0b9f7826d5213bf62a3e85a74
now acaf8019b252c57f3df107202a1e2003825cac4b
1: c746c190ec ! 1: acaf8019b2 Disable submit on enter in autocomplete inputs
@@ -10,7 +10,7 @@
watcher and groups on ticket modify people pages, create depends
on link forms.
- I#32632
+ Fixes: I#32632
diff --git a/share/static/js/util.js b/share/static/js/util.js
--- a/share/static/js/util.js
@@ -21,29 +21,11 @@
+// disable submit on enter in autocomplete boxes
+jQuery(function() {
-+ jQuery('input[data-autocomplete]').each(function() {
++ jQuery('input[data-autocomplete], input.ui-autocomplete-input').each(function() {
+ var input = jQuery(this);
+
-+ // don't disable autosubmit for Queue select, CreateTicketInQueue, or Ticket autocompletes on Ticket pages
-+ if (input.attr('data-autocomplete-autosubmit') || input.attr('data-autocomplete') === 'Queues' ||
-+ input.attr('data-autocomplete') === 'Tickets') {
-+ return true;
-+ }
-+
-+ // don't disable autosubmit for watcher inputs
-+ var watcher_regex = new RegExp('^WatcherAddressEmail');
-+ if (watcher_regex.test(input.attr('id'))) {
-+ return true;
-+ }
-+
-+ // don't disable autocompleteselect events like those on the Admin pages.
-+ // autocomplete-UserString, autocomplete-GroupString
-+ if (input.attr('id') === 'autocomplete-UserString' || input.attr('id') === 'autocomplete-GroupString') {
-+ return true;
-+ }
-+
+ input.on('keypress', function(event) {
-+ if (event.keyCode === 13) {
++ if (event.keyCode === 13 && jQuery('ul.ui-autocomplete').is(':visible')) {
+ return false;
+ }
+ });
More information about the rt-commit
mailing list