mirror of
https://github.com/mempool/mempool.git
synced 2024-12-27 08:44:26 +01:00
Address suggestion fixes: Added ellipsis on long addresses. Search on item select.
This commit is contained in:
parent
7f7c6ef6f8
commit
0ded140c72
@ -1,7 +1,7 @@
|
||||
<form [formGroup]="searchForm" (submit)="searchForm.valid && search()" class="mr-4" novalidate>
|
||||
<div class="form-row">
|
||||
<div style="width: 350px;" class="mr-2">
|
||||
<input #instance="ngbTypeahead" [ngbTypeahead]="typeaheadSearch" (focus)="focus$.next($any($event).target.value)" (click)="click$.next($any($event).target.value)" formControlName="searchText" type="text" class="form-control" placeholder="Transaction, block height, hash or address">
|
||||
<input #instance="ngbTypeahead" [ngbTypeahead]="typeaheadSearch" (selectItem)="itemSelected()" (focus)="focus$.next($any($event).target.value)" (click)="click$.next($any($event).target.value)" formControlName="searchText" type="text" class="form-control" placeholder="Transaction, block height, hash or address">
|
||||
</div>
|
||||
<div>
|
||||
<button type="submit" class="btn btn-block btn-primary">Search</button>
|
||||
|
@ -0,0 +1,6 @@
|
||||
:host ::ng-deep .dropdown-item {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
width: 375px;
|
||||
text-overflow: ellipsis;
|
||||
}
|
@ -66,6 +66,10 @@ export class SearchFormComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
itemSelected() {
|
||||
setTimeout(() => this.search());
|
||||
}
|
||||
|
||||
search() {
|
||||
const searchText = this.searchForm.value.searchText.trim();
|
||||
if (searchText) {
|
||||
|
Loading…
Reference in New Issue
Block a user