We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 28ca209 commit 98683f1Copy full SHA for 98683f1
app/components/search-input.js
@@ -57,6 +57,9 @@ export default class SearchInput extends Component {
57
58
@action onfocus() {
59
if (this.query.length > 0 && this.searchService.hasStaleResults()) {
60
+ // clearing the results avoids a flash of stale content while the search
61
+ // is performed
62
+ this.searchService.clearResults();
63
this.searchService.search.perform(this.query);
64
}
65
app/services/search.js
@@ -54,4 +54,8 @@ export default Service.extend({
54
return this._lastQueriedProjectVersion !== null
55
&& this._projectVersion !== this._lastQueriedProjectVersion;
56
},
+
+ clearResults() {
+ set(this, 'results', emberArray());
+ }
});
0 commit comments