diff options
author | Byron Jones <glob@mozilla.com> | 2015-06-02 07:32:01 +0200 |
---|---|---|
committer | Byron Jones <glob@mozilla.com> | 2015-06-02 07:32:01 +0200 |
commit | 89e70fd3999e0155c6b81a7b94288c84bb849c32 (patch) | |
tree | 6f723b0035b1b23fb3a5a88c84b4fe5feb8b93c0 /js | |
parent | 00b57b53faec42b68b257ee3ad9f8cecbd0aff02 (diff) | |
download | bugzilla-89e70fd3999e0155c6b81a7b94288c84bb849c32.tar.gz bugzilla-89e70fd3999e0155c6b81a7b94288c84bb849c32.tar.xz |
Bug 1169418: Can't enter space in Keyword field
Diffstat (limited to 'js')
-rw-r--r-- | js/field.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/js/field.js b/js/field.js index fdacd4728..d8ede471b 100644 --- a/js/field.js +++ b/js/field.js @@ -710,7 +710,7 @@ $(function() { that.removeClass('autocomplete-running'); if (document.activeElement != this) that.devbridgeAutocomplete('hide'); - }; + } var options_user = { serviceUrl: 'rest/user', @@ -724,6 +724,7 @@ $(function() { minChars: 3, tabDisabled: true, autoSelectFirst: true, + triggerSelectOnValidInput: false, transformResult: function(response) { response = $.parseJSON(response); return { @@ -757,6 +758,7 @@ $(function() { that.addClass('autocomplete-running'); that.data('counter', that.data('counter') + 1); + return true; }, onSearchComplete: searchComplete, onSearchError: searchComplete @@ -795,11 +797,20 @@ $(function() { delimiter: /,\s*/, minChars: 0, autoSelectFirst: true, + triggerSelectOnValidInput: false, formatResult: function(suggestion, currentValue) { // disable <b> wrapping of matched substring return suggestion.value.htmlEncode(); }, + onSearchStart: function(params) { + var that = $(this); + // adding spaces shouldn't initiate a new search + var parts = that.val().split(/,\s*/); + var query = parts[parts.length - 1]; + return query === $.trim(query); + }, onSelect: function() { + this.value = this.value + ', '; this.focus(); } }); |