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

Commit

Permalink
fix(combobox): Fixes an issue where the value was reset.
Browse files Browse the repository at this point in the history
Fixes #1427
  • Loading branch information
tomheller committed Aug 5, 2020
1 parent a1d2838 commit c66c013
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions libs/barista-components/experimental/combobox/src/combobox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ import {
switchMap,
startWith,
tap,
debounceTime,
} from 'rxjs/operators';
import {
CanDisable,
Expand Down Expand Up @@ -305,6 +306,7 @@ export class DtCombobox<T> extends _DtComboboxMixinBase
fromEvent(this._searchInput.nativeElement, 'input')
.pipe(
tap(() => this._autocompleteTrigger.openPanel()),
debounceTime(100),
map((event: KeyboardEvent): string => {
event.stopPropagation();
return this._searchInput.nativeElement.value;
Expand All @@ -314,9 +316,11 @@ export class DtCombobox<T> extends _DtComboboxMixinBase
.subscribe((query) => {
this.filterChange.emit(new DtComboboxFilterChange(query));
});
fromEvent(this._searchInput.nativeElement, 'blur').subscribe(() => {
this._resetInputValue();
});
fromEvent(this._searchInput.nativeElement, 'blur')
.pipe(takeUntil(this._destroy))
.subscribe(() => {
this._resetInputValue();
});
}

ngAfterContentInit(): void {
Expand Down

0 comments on commit c66c013

Please sign in to comment.