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

FEAT #15550 TIME 0:10 Be able to validate with the Enter key on the search page for the two inputs

parent 67c6cef6
No related branches found
No related tags found
No related merge requests found
...@@ -154,7 +154,7 @@ ...@@ -154,7 +154,7 @@
<ion-item> <ion-item>
<ion-label color="secondary" position="floating">{{'lang.' + filter.id + 'Search' | translate}} <ion-label color="secondary" position="floating">{{'lang.' + filter.id + 'Search' | translate}}
</ion-label> </ion-label>
<ion-input [(ngModel)]="filter.val" [value]="filter.val"></ion-input> <ion-input [(ngModel)]="filter.val" [value]="filter.val" (keyup.enter)="launchSearch()" (ionChange)="checkInput()"></ion-input>
</ion-item> </ion-item>
</ng-container> </ng-container>
<ng-container *ngIf="filter.type === 'checkbox'"> <ng-container *ngIf="filter.type === 'checkbox'">
......
...@@ -452,4 +452,13 @@ export class SearchComponent implements OnInit { ...@@ -452,4 +452,13 @@ export class SearchComponent implements OnInit {
const obj = this.filters.filter((item: any) => item.id === 'workflowStates')[0].values; const obj = this.filters.filter((item: any) => item.id === 'workflowStates')[0].values;
return obj.find((element: any) => element.id === filter).label; return obj.find((element: any) => element.id === filter).label;
} }
checkInput() {
if ((this.filters.find((el: any) => el.id === 'title').val === '') && (this.filters.find((el: any) => el.id === 'reference').val === '')) {
if (this.filters.find((el: any) => el.id === 'workflowStates').val.length === 0 || this.filters.find((el: any) => el.id === 'workflowUsers').val.length === 0) {
this.clearFilters();
this.currentFilters = [];
}
}
}
} }
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