Skip to content

Commit 6413b34

Browse files
authored
Merge pull request #364 from UiPath/fix/debounce_after_inputs_init
fix(suggest): use debounceTime input after it is set
2 parents 4048b38 + e3a33a3 commit 6413b34

File tree

5 files changed

+37
-33
lines changed

5 files changed

+37
-33
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# v14.8.3 (2023-06-16)
2+
* **suggest** use debounceTime input after it is set
3+
14
# v14.8.2 (2023-05-31)
25
* **grid** move radio btn in radio group
36

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-components",
3-
"version": "14.8.2",
3+
"version": "14.8.3",
44
"author": {
55
"name": "UiPath Inc",
66
"url": "https://uipath.com"

projects/angular/components/ui-suggest/src/ui-suggest.component.ts

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,7 @@ export class UiSuggestComponent extends UiSuggestMatFormFieldDirective
779779
end: Number.POSITIVE_INFINITY,
780780
};
781781

782-
private _inputChange$: Observable<string>;
782+
private _inputChange$!: Observable<string>;
783783
private _drillDown = false;
784784
private _lazyLoadLastArgument: any[] = ['', 0, 0];
785785

@@ -810,34 +810,6 @@ export class UiSuggestComponent extends UiSuggestMatFormFieldDirective
810810
cd,
811811
ngControl,
812812
);
813-
814-
this._inputChange$ = combineLatest([
815-
this.inputControl.valueChanges.pipe(
816-
startWith(''),
817-
map((v = '') => v.trim()),
818-
distinctUntilChanged(),
819-
filter(v => v.length >= this.minChars),
820-
tap(v => v && this.multiple && this.open()),
821-
tap(this._setLoadingState),
822-
debounceTime(this.debounceTime),
823-
filter(_ => !!this.searchSourceFactory),
824-
),
825-
this._disabled$.pipe(filter(v => !v)),
826-
this._fetchStrategy$
827-
.pipe(
828-
switchMap(strategy => {
829-
switch (strategy) {
830-
case 'onOpen':
831-
return this._isOpen$.pipe(filter(o => !!o));
832-
case 'eager':
833-
return of(strategy);
834-
}
835-
}),
836-
),
837-
]).pipe(
838-
map(([value]) => value),
839-
);
840-
841813
this._initResizeObserver();
842814

843815
this._height$.subscribe(heightValue => {
@@ -877,6 +849,35 @@ export class UiSuggestComponent extends UiSuggestMatFormFieldDirective
877849
this._initOverlayPositions();
878850
this.dropdownPosition = [this.direction && this.direction === 'up' ? this.upPosition : this.downPosition];
879851

852+
this._inputChange$ = combineLatest([
853+
this.inputControl.valueChanges.pipe(
854+
startWith(''),
855+
map((v = '') => v.trim()),
856+
distinctUntilChanged(),
857+
filter(v => v.length >= this.minChars),
858+
tap(v => v && this.multiple && this.open()),
859+
tap(this._setLoadingState),
860+
debounceTime(this.debounceTime),
861+
filter(_ => !!this.searchSourceFactory),
862+
),
863+
this._disabled$.pipe(
864+
filter(v => !v),
865+
),
866+
this._fetchStrategy$
867+
.pipe(
868+
switchMap(strategy => {
869+
switch (strategy) {
870+
case 'onOpen':
871+
return this._isOpen$.pipe(filter(o => !!o));
872+
case 'eager':
873+
return of(strategy);
874+
}
875+
}),
876+
),
877+
]).pipe(
878+
map(([value]) => value as any),
879+
);
880+
880881
merge(
881882
this._reset$.pipe(
882883
map(_ => ''),

projects/angular/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@uipath/angular",
3-
"version": "14.8.2",
3+
"version": "14.8.3",
44
"license": "MIT",
55
"author": {
66
"name": "UiPath Inc",

0 commit comments

Comments
 (0)