Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
fix(filter-field): Fixes the async example when using freeText
Browse files Browse the repository at this point in the history
  • Loading branch information
rowa-audil committed Jul 5, 2021
1 parent e2fb4f4 commit b26def9
Showing 1 changed file with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,23 +65,21 @@ export class DtExampleFilterFieldAsync {
currentFilterChanged(
event: DtFilterFieldCurrentFilterChangeEvent<any>,
): void {
if (
event.added[0] === this.DATA.autocomplete[0] ||
this.ASYNC_DATA.autocomplete.find((name) => name === event.removed[0])
) {
if (event.added[0] === this.DATA.autocomplete[0]) {
// Emulate a http request
setTimeout(() => {
this._dataSource.data = this.ASYNC_DATA;
}, 1000);
} else if (this.ASYNC_DATA.name === event.currentFilter[0].name) {
this._dataSource.data = this.ASYNC_DATA;
}
if (
event.added[0] === this.DATA.autocomplete[1] ||
this.ASYNC_DATA_2.suggestions.find((name) => name === event.removed[0])
) {
if (event.added[0] === this.DATA.autocomplete[1]) {
// Emulate a http request
setTimeout(() => {
this._dataSource.data = this.ASYNC_DATA_2;
}, 1000);
} else if (this.ASYNC_DATA_2.name === event.currentFilter[0].name) {
this._dataSource.data = this.ASYNC_DATA_2;
}
}
}

0 comments on commit b26def9

Please sign in to comment.