forked from MapComplete/MapComplete
		
	Remove accidental empty query
This commit is contained in:
		
							parent
							
								
									2dd428497e
								
							
						
					
					
						commit
						82e5a80c0d
					
				
					 1 changed files with 4 additions and 0 deletions
				
			
		| 
						 | 
					@ -44,11 +44,15 @@ export class SearchAndGo extends UIElement {
 | 
				
			||||||
    // Triggered by 'enter' or onclick
 | 
					    // Triggered by 'enter' or onclick
 | 
				
			||||||
    private RunSearch() {
 | 
					    private RunSearch() {
 | 
				
			||||||
        const searchString = this._searchField.GetValue().data;
 | 
					        const searchString = this._searchField.GetValue().data;
 | 
				
			||||||
 | 
					        if(searchString === undefined || searchString === ""){
 | 
				
			||||||
 | 
					            return;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
        this._searchField.GetValue().setData("");
 | 
					        this._searchField.GetValue().setData("");
 | 
				
			||||||
        this._placeholder.setData(Translations.t.general.search.searching);
 | 
					        this._placeholder.setData(Translations.t.general.search.searching);
 | 
				
			||||||
        const self = this;
 | 
					        const self = this;
 | 
				
			||||||
        Geocoding.Search(searchString,  (result) => {
 | 
					        Geocoding.Search(searchString,  (result) => {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            console.log("Search result", result)
 | 
				
			||||||
                if (result.length == 0) {
 | 
					                if (result.length == 0) {
 | 
				
			||||||
                    self._placeholder.setData(Translations.t.general.search.nothing);
 | 
					                    self._placeholder.setData(Translations.t.general.search.nothing);
 | 
				
			||||||
                    return;
 | 
					                    return;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue