Search bar fixes.

This commit is contained in:
softsimon 2022-08-30 22:36:13 +02:00
parent 0dfda66578
commit a2e6b265d3
No known key found for this signature in database
GPG Key ID: 488D7DCFB5A430D7
3 changed files with 9 additions and 1 deletions

View File

@ -15,5 +15,5 @@
</form>
<ng-template #searchLoading>
<div class="spinner-border spinner-border-sm text-light" role="status" aria-hidden="true"></div>
<div class="spinner-border spinner-border-sm text-light" role="status" aria-hidden="true" (click)="searchForm.valid && search()"></div>
</ng-template>

View File

@ -156,6 +156,7 @@ export class SearchFormComponent implements OnInit {
this.navigate('/tx/', matches[0]);
}
} else {
this.searchResults.searchButtonClick();
this.isSearching = false;
}
}

View File

@ -25,6 +25,13 @@ export class SearchResultsComponent implements OnChanges {
}
}
searchButtonClick() {
if (this.resultsFlattened[this.activeIdx]) {
this.selectedResult.emit(this.resultsFlattened[this.activeIdx]);
this.results = null;
}
}
handleKeyDown(event: KeyboardEvent) {
switch (event.key) {
case 'ArrowDown':