BrowseDashboards: Prevent unnecessary searches (#76424)

pull/77044/head
Josh Hunt 2 years ago committed by GitHub
parent e743aa54b8
commit 685b494e05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      public/app/features/search/state/SearchStateManager.ts

@ -57,7 +57,7 @@ export class SearchStateManager extends StateManagerBase<SearchState> {
eventTrackingNamespace: folderUid ? 'manage_dashboards' : 'dashboard_search',
});
if (doInitialSearch) {
if (doInitialSearch && this.hasSearchFilters()) {
this.doSearch();
}
}
@ -81,8 +81,11 @@ export class SearchStateManager extends StateManagerBase<SearchState> {
sort: this.state.sort,
});
// issue new search query
this.doSearchWithDebounce();
// Prevent searching when user is only clearing the input.
// We don't show these results anyway
if (this.hasSearchFilters()) {
this.doSearchWithDebounce();
}
}
onCloseSearch = () => {

Loading…
Cancel
Save