@@ -710,7 +710,7 @@ $(function() {
710710 that . removeClass ( 'autocomplete-running' ) ;
711711 if ( document . activeElement != this )
712712 that . devbridgeAutocomplete ( 'hide' ) ;
713- } ;
713+ }
714714
715715 var options_user = {
716716 serviceUrl : 'rest/user' ,
@@ -724,6 +724,7 @@ $(function() {
724724 minChars : 3 ,
725725 tabDisabled : true ,
726726 autoSelectFirst : true ,
727+ triggerSelectOnValidInput : false ,
727728 transformResult : function ( response ) {
728729 response = $ . parseJSON ( response ) ;
729730 return {
@@ -757,6 +758,7 @@ $(function() {
757758
758759 that . addClass ( 'autocomplete-running' ) ;
759760 that . data ( 'counter' , that . data ( 'counter' ) + 1 ) ;
761+ return true ;
760762 } ,
761763 onSearchComplete : searchComplete ,
762764 onSearchError : searchComplete
@@ -795,11 +797,20 @@ $(function() {
795797 delimiter : / , \s * / ,
796798 minChars : 0 ,
797799 autoSelectFirst : true ,
800+ triggerSelectOnValidInput : false ,
798801 formatResult : function ( suggestion , currentValue ) {
799802 // disable <b> wrapping of matched substring
800803 return suggestion . value . htmlEncode ( ) ;
801804 } ,
805+ onSearchStart : function ( params ) {
806+ var that = $ ( this ) ;
807+ // adding spaces shouldn't initiate a new search
808+ var parts = that . val ( ) . split ( / , \s * / ) ;
809+ var query = parts [ parts . length - 1 ] ;
810+ return query === $ . trim ( query ) ;
811+ } ,
802812 onSelect : function ( ) {
813+ this . value = this . value + ', ' ;
803814 this . focus ( ) ;
804815 }
805816 } ) ;
0 commit comments