BrowseDashboards: Prevent unnecessary searches (#76424)

This commit is contained in:
Josh Hunt 2023-10-23 08:44:07 +00:00 committed by GitHub
parent e743aa54b8
commit 685b494e05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 = () => {