Address search with middle ellipsis mobile fix

This commit is contained in:
softsimon 2022-03-05 14:19:44 +01:00
parent e5b2440b45
commit daa7079338
No known key found for this signature in database
GPG Key ID: 488D7DCFB5A430D7
2 changed files with 12 additions and 3 deletions

View File

@ -1,10 +1,18 @@
:host ::ng-deep {
.dropdown-item {
white-space: nowrap;
width: 410px;
width: calc(100% - 34px);
}
.dropdown-menu {
width: 410px;
width: calc(100% - 34px);
}
@media (min-width: 768px) {
.dropdown-item {
width: 410px;
}
.dropdown-menu {
width: 410px;
}
}
}

View File

@ -23,6 +23,7 @@ export class SearchFormComponent implements OnInit {
typeaheadSearchFn: ((text: Observable<string>) => Observable<readonly any[]>);
searchForm: FormGroup;
isMobile = (window.innerWidth <= 767.98);
@Output() searchTriggered = new EventEmitter();
regexAddress = /^([a-km-zA-HJ-NP-Z1-9]{26,35}|[a-km-zA-HJ-NP-Z1-9]{80}|[a-z]{2,5}1[ac-hj-np-z02-9]{8,100}|[A-Z]{2,5}1[AC-HJ-NP-Z02-9]{8,100})$/;
@ -34,7 +35,7 @@ export class SearchFormComponent implements OnInit {
focus$ = new Subject<string>();
click$ = new Subject<string>();
formatterFn = (address: string) => this.shortenStringPipe.transform(address, 40);
formatterFn = (address: string) => this.shortenStringPipe.transform(address, this.isMobile ? 33 : 40);
constructor(
private formBuilder: FormBuilder,