Skip to content

Commit

Permalink
Fixed #2788
Browse files Browse the repository at this point in the history
  • Loading branch information
mertsincan committed May 29, 2017
1 parent 39e8d22 commit 3a005df
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions components/autocomplete/autocomplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ export class AutoComplete implements AfterViewInit,AfterViewChecked,ControlValue
filled: boolean;

inputClick: boolean;

inputKeyDown: boolean;

noResults: boolean;

Expand Down Expand Up @@ -247,6 +249,10 @@ export class AutoComplete implements AfterViewInit,AfterViewChecked,ControlValue
}

onInput(event: KeyboardEvent) {
if(!this.inputKeyDown) {
return;
}

let value = (<HTMLInputElement> event.target).value;
if(!this.multiple) {
this.onModelChange(value);
Expand All @@ -270,6 +276,7 @@ export class AutoComplete implements AfterViewInit,AfterViewChecked,ControlValue
this.suggestions = null;
}
this.updateFilledState();
this.inputKeyDown = false;
}

onInputClick(event: MouseEvent) {
Expand Down Expand Up @@ -433,6 +440,8 @@ export class AutoComplete implements AfterViewInit,AfterViewChecked,ControlValue
break;
}
}

this.inputKeyDown = true;
}

onInputFocus(event) {
Expand Down

0 comments on commit 3a005df

Please sign in to comment.