diff options
Diffstat (limited to 'catalog-ui/src/app/ng2/shared')
-rw-r--r-- | catalog-ui/src/app/ng2/shared/search-bar/search-bar.component.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/catalog-ui/src/app/ng2/shared/search-bar/search-bar.component.ts b/catalog-ui/src/app/ng2/shared/search-bar/search-bar.component.ts index 2835d20ba4..08bdf2030f 100644 --- a/catalog-ui/src/app/ng2/shared/search-bar/search-bar.component.ts +++ b/catalog-ui/src/app/ng2/shared/search-bar/search-bar.component.ts @@ -15,7 +15,9 @@ export class SearchBarComponent { @Output() searchButtonClicked: EventEmitter<string> = new EventEmitter<string>(); searchButtonClick = (): void => { - this.searchButtonClicked.emit(this.searchQuery); + if (this.searchQuery) { //do not allow empty search + this.searchButtonClicked.emit(this.searchQuery); + } } searchQueryChange = ($event): void => { @@ -24,7 +26,7 @@ export class SearchBarComponent { private clearSearchQuery = (): void => { this.searchQuery = ""; - this.searchButtonClick(); + this.searchButtonClicked.emit(this.searchQuery); } } |