Skip to content

Commit

Permalink
Fix #667
Browse files Browse the repository at this point in the history
  • Loading branch information
tfrancart committed Nov 2, 2024
1 parent da6235c commit e64e964
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/sparnatural/components/widgets/AutoCompleteWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,20 @@ export class AutoCompleteWidget extends AbstractWidget {
});
});

// toggle spinner
if(list.length == 0) {
this.toggleSpinner(I18n.labels.AutocompleteSpinner_NoResults);
} else {
this.toggleSpinner('')
}

// build final list
awesomplete.list = list;
awesomplete.evaluate();
}

// TODO : this is not working for now
let errorCallback = (payload:any) => {
this.html.append(errorHtml);
this.toggleSpinner(I18n.labels.AutocompleteSpinner_NoResults);
}

// when user selects a value from the autocompletion list...
Expand Down Expand Up @@ -132,7 +138,8 @@ export class AutoCompleteWidget extends AbstractWidget {
phrase,
callback,
errorCallback
)
);
this.toggleSpinner(I18n.labels.AutocompleteSpinner_Searching)
},
350
);
Expand Down

0 comments on commit e64e964

Please sign in to comment.