autocomplete fix
This commit is contained in:
parent
7f71b7146b
commit
4ae13704c5
|
@ -9,7 +9,7 @@ import { AutoCompleteGroup } from '@app/library/auto-complete/auto-complete-grou
|
||||||
import { MultipleAutoCompleteConfiguration } from '@app/library/auto-complete/multiple/multiple-auto-complete-configuration';
|
import { MultipleAutoCompleteConfiguration } from '@app/library/auto-complete/multiple/multiple-auto-complete-configuration';
|
||||||
import { BaseComponent } from '@common/base/base.component';
|
import { BaseComponent } from '@common/base/base.component';
|
||||||
import { Observable, of as observableOf, Subject } from 'rxjs';
|
import { Observable, of as observableOf, Subject } from 'rxjs';
|
||||||
import { debounceTime, distinctUntilChanged, map, mergeMap, startWith, takeUntil } from 'rxjs/operators';
|
import { debounceTime, distinctUntilChanged, map, mergeMap, startWith, takeUntil, switchMap } from 'rxjs/operators';
|
||||||
|
|
||||||
export class CustomComponentBase extends BaseComponent {
|
export class CustomComponentBase extends BaseComponent {
|
||||||
constructor(
|
constructor(
|
||||||
|
@ -213,7 +213,7 @@ export class MultipleAutoCompleteComponent extends _CustomComponentMixinBase imp
|
||||||
debounceTime(this.requestDelay),
|
debounceTime(this.requestDelay),
|
||||||
distinctUntilChanged(),
|
distinctUntilChanged(),
|
||||||
distinctUntilChanged(),
|
distinctUntilChanged(),
|
||||||
mergeMap(query => this.filter(query)));
|
switchMap(query => this.filter(query)));
|
||||||
|
|
||||||
if (this.configuration.groupingFn) { this._groupedItems = this._items.pipe(map(items => this.configuration.groupingFn(items))); }
|
if (this.configuration.groupingFn) { this._groupedItems = this._items.pipe(map(items => this.configuration.groupingFn(items))); }
|
||||||
}
|
}
|
||||||
|
@ -286,7 +286,7 @@ export class MultipleAutoCompleteComponent extends _CustomComponentMixinBase imp
|
||||||
}
|
}
|
||||||
|
|
||||||
get requestDelay(): number {
|
get requestDelay(): number {
|
||||||
return this.configuration.requestDelay != null ? this.configuration.requestDelay : 200;
|
return this.configuration.requestDelay != null ? this.configuration.requestDelay : 400;
|
||||||
}
|
}
|
||||||
|
|
||||||
get minFilteringChars(): number {
|
get minFilteringChars(): number {
|
||||||
|
|
|
@ -9,7 +9,7 @@ import { AutoCompleteGroup } from '@app/library/auto-complete/auto-complete-grou
|
||||||
import { SingleAutoCompleteConfiguration } from '@app/library/auto-complete/single/single-auto-complete-configuration';
|
import { SingleAutoCompleteConfiguration } from '@app/library/auto-complete/single/single-auto-complete-configuration';
|
||||||
import { BaseComponent } from '@common/base/base.component';
|
import { BaseComponent } from '@common/base/base.component';
|
||||||
import { Observable, of as observableOf, Subject } from 'rxjs';
|
import { Observable, of as observableOf, Subject } from 'rxjs';
|
||||||
import { debounceTime, distinctUntilChanged, map, mergeMap, startWith, takeUntil } from 'rxjs/operators';
|
import { debounceTime, distinctUntilChanged, map, mergeMap, startWith, takeUntil, switchMap } from 'rxjs/operators';
|
||||||
|
|
||||||
|
|
||||||
export class CustomComponentBase extends BaseComponent {
|
export class CustomComponentBase extends BaseComponent {
|
||||||
|
@ -225,7 +225,7 @@ export class SingleAutoCompleteComponent extends _CustomComponentMixinBase imple
|
||||||
startWith(null),
|
startWith(null),
|
||||||
debounceTime(this.requestDelay),
|
debounceTime(this.requestDelay),
|
||||||
distinctUntilChanged(),
|
distinctUntilChanged(),
|
||||||
mergeMap(query => this.filter(query)));
|
switchMap(query => this.filter(query)));
|
||||||
|
|
||||||
if (this.configuration.groupingFn) { this._groupedItems = this._items.pipe(map(items => this.configuration.groupingFn(items))); }
|
if (this.configuration.groupingFn) { this._groupedItems = this._items.pipe(map(items => this.configuration.groupingFn(items))); }
|
||||||
}
|
}
|
||||||
|
@ -307,7 +307,7 @@ export class SingleAutoCompleteComponent extends _CustomComponentMixinBase imple
|
||||||
}
|
}
|
||||||
|
|
||||||
get requestDelay(): number {
|
get requestDelay(): number {
|
||||||
return this.configuration.requestDelay != null ? this.configuration.requestDelay : 200;
|
return this.configuration.requestDelay != null ? this.configuration.requestDelay : 400;
|
||||||
}
|
}
|
||||||
|
|
||||||
get minFilteringChars(): number {
|
get minFilteringChars(): number {
|
||||||
|
|
Loading…
Reference in New Issue