From 802087905c2db32756553116ea4042976f6c06aa Mon Sep 17 00:00:00 2001 From: sohail amjad Date: Wed, 26 Jun 2024 23:59:24 +0530 Subject: [PATCH] search issue resolved --- .../create-request-form.component.html | 5 +++-- .../create-request-form.component.ts | 13 +++++++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/project/ws/app/src/lib/routes/home/components/request-list/create-request-form/create-request-form.component.html b/project/ws/app/src/lib/routes/home/components/request-list/create-request-form/create-request-form.component.html index f14aa4153..389710785 100644 --- a/project/ws/app/src/lib/routes/home/components/request-list/create-request-form/create-request-form.component.html +++ b/project/ws/app/src/lib/routes/home/components/request-list/create-request-form/create-request-form.component.html @@ -303,7 +303,7 @@ + (keyup)="searchValueData('assigneeText')" (keydown.space)="$event.stopPropagation()" formControlName="assigneeText" matInput> {{option.orgName}} @@ -338,7 +338,8 @@ - + diff --git a/project/ws/app/src/lib/routes/home/components/request-list/create-request-form/create-request-form.component.ts b/project/ws/app/src/lib/routes/home/components/request-list/create-request-form/create-request-form.component.ts index 32c08f251..29c2a27c2 100644 --- a/project/ws/app/src/lib/routes/home/components/request-list/create-request-form/create-request-form.component.ts +++ b/project/ws/app/src/lib/routes/home/components/request-list/create-request-form/create-request-form.component.ts @@ -7,6 +7,7 @@ import { CompetencyViewComponent } from '../competency-view/competency-view.comp import { ConfirmationBoxComponent } from '../../../../training-plan/components/confirmation-box/confirmation.box.component' /* tslint:disable */ import _ from 'lodash' +import { debounceTime, distinctUntilChanged, startWith } from 'rxjs/operators' /* tslint:enable */ @Component({ @@ -178,12 +179,20 @@ export class CreateRequestFormComponent implements OnInit { searchValueData(searchValue: any) { if (searchValue === 'providerText') { - this.requestForm.controls['providerText'].valueChanges.subscribe((newValue: any) => { + this.requestForm.controls['providerText'].valueChanges.pipe( + debounceTime(100), + distinctUntilChanged(), + startWith(''), + ).subscribe((newValue: any) => { this.filteredRequestType = this.filterOrgValues(newValue, this.requestTypeData) }) } if (searchValue === 'assigneeText') { - this.requestForm.controls['assigneeText'].valueChanges.subscribe((newValue: any) => { + this.requestForm.controls['assigneeText'].valueChanges.pipe( + debounceTime(100), + distinctUntilChanged(), + startWith(''), + ).subscribe((newValue: any) => { this.filteredAssigneeType = this.filterOrgValues(newValue, this.requestTypeData) }) }