File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -186,6 +186,7 @@ Set input
186186#### Parameters
187187
188188* ` searchInput ` ** [ string] [ 76 ] ** location name or other search input
189+ - ` showSuggestions ` ** [ boolean] [ 80 ] ** display suggestion on setInput call (optional, default ` false ` )
189190
190191Returns ** [ MapboxGeocoder] [ 2 ] ** this
191192
Original file line number Diff line number Diff line change @@ -928,15 +928,20 @@ MapboxGeocoder.prototype = {
928928 /**
929929 * Set input
930930 * @param {string } searchInput location name or other search input
931+ * @param {boolean } [showSuggestions=false] display suggestion on setInput call
931932 * @returns {MapboxGeocoder } this
932933 */
933- setInput : function ( searchInput ) {
934+ setInput : function ( searchInput , showSuggestions ) {
935+ if ( showSuggestions === undefined ) {
936+ showSuggestions = false
937+ }
934938 // Set input value to passed value and clear everything else.
935939 this . _inputEl . value = searchInput ;
936940 this . _typeahead . selected = null ;
937941 this . _typeahead . clear ( ) ;
938942 if ( searchInput . length >= this . options . minLength ) {
939- this . _geocode ( searchInput ) ;
943+ showSuggestions ? this . _geocode ( searchInput ) : this . _onChange ( ) ;
944+ }
940945 }
941946 return this ;
942947 } ,
You can’t perform that action at this time.
0 commit comments