Skip to content
Snippets Groups Projects
Commit aed73d08 authored by Hamza HRAMCHI's avatar Hamza HRAMCHI
Browse files

FIX #16648 TIME 0:04 fix js error when clicking on cancel button on the search field

parent ce9443be
No related branches found
No related tags found
No related merge requests found
......@@ -36,7 +36,7 @@
</ion-avatar>
<ion-header *ngIf="!isAdminRoute()">
<ion-toolbar color="light">
<ion-title *ngIf="!searchMode" (click)="search();" [title]="'lang.filterInfo' | translate" style="text-align: center;font-size: 14px;">
<ion-title *ngIf="!searchMode" (click)="search($event);" [title]="'lang.filterInfo' | translate" style="text-align: center;font-size: 14px;">
<span [class.primary]="signaturesService.mode != ''">{{signaturesService.documentsListCount.current}}</span>
{{'lang.documents' | translate}}
<span class="primary"
......@@ -44,7 +44,7 @@
&nbsp;
<ion-icon color="primary" name="search-outline"></ion-icon>
</ion-title>
<ion-searchbar *ngIf="searchMode" #searchInput [placeholder]="'lang.filterInfo' | translate" showCancelButton="always" (ionCancel)="search();searchMode=!searchMode;" [formControl]="searchTerm"></ion-searchbar>
<ion-searchbar *ngIf="searchMode" #searchInput [placeholder]="'lang.filterInfo' | translate" showCancelButton="always" (ionCancel)="search($event);searchMode=!searchMode;" [formControl]="searchTerm"></ion-searchbar>
</ion-toolbar>
</ion-header>
<ion-header *ngIf="!isAdminRoute()" style="background: white;">
......
......@@ -102,13 +102,15 @@ export class SidebarComponent implements OnInit, AfterViewInit {
this.router.navigate(['/search']);
}
search() {
search(event: any) {
this.searchMode = true;
this.signaturesService.mode = '';
this.filter('');
setTimeout(() => {
this.searchInput.value = '';
this.searchInput.setFocus();
if (event.type !== 'ionCancel') {
this.searchInput.value = '';
this.searchInput.setFocus();
}
}, 0);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment