mirror of
https://github.com/datahub-project/datahub.git
synced 2025-08-18 14:16:48 +00:00
fix(search): have search bar ignore blank searches (#2556)
This commit is contained in:
parent
66d79be4b1
commit
5de346b7ad
@ -115,6 +115,9 @@ export const HomePageHeader = () => {
|
||||
const isAnalyticsEnabled = data && data.isAnalyticsEnabled;
|
||||
|
||||
const onSearch = (query: string) => {
|
||||
if (query.trim().length === 0) {
|
||||
return;
|
||||
}
|
||||
analytics.event({
|
||||
type: EventType.SearchEvent,
|
||||
query,
|
||||
|
@ -55,6 +55,9 @@ export const SearchPage = () => {
|
||||
const filters: Array<FacetFilterInput> = useFilters(params);
|
||||
|
||||
const onSearch = (q: string) => {
|
||||
if (query.trim().length === 0) {
|
||||
return;
|
||||
}
|
||||
analytics.event({
|
||||
type: EventType.SearchEvent,
|
||||
query: q,
|
||||
|
@ -38,6 +38,9 @@ export const SearchablePage = ({ initialQuery, onSearch, onAutoComplete, childre
|
||||
const [getAutoCompleteResults, { data: suggestionsData }] = useGetAutoCompleteResultsLazyQuery();
|
||||
|
||||
const search = (query: string) => {
|
||||
if (query.trim().length === 0) {
|
||||
return;
|
||||
}
|
||||
analytics.event({
|
||||
type: EventType.SearchEvent,
|
||||
query,
|
||||
|
Loading…
x
Reference in New Issue
Block a user