Skip to content

Commit

Permalink
Fixed #2647
Browse files Browse the repository at this point in the history
  • Loading branch information
Çağatay Çivici committed Apr 30, 2017
1 parent 94a3713 commit e76a79c
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions components/autocomplete/autocomplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export class AutoComplete implements AfterViewInit,AfterViewChecked,ControlValue
set suggestions(val:any[]) {
this._suggestions = val;

if(this.panelEL.nativeElement) {
if(this.panelEL && this.panelEL.nativeElement) {
if(this._suggestions && this._suggestions.length) {
this.show();
this.suggestionsUpdated = true;
Expand Down Expand Up @@ -304,12 +304,14 @@ export class AutoComplete implements AfterViewInit,AfterViewChecked,ControlValue
}

show() {
let hasFocus = this.multiple ? document.activeElement == this.multiInputEL.nativeElement : document.activeElement == this.inputEL.nativeElement ;
if(!this.panelVisible && hasFocus) {
this.panelVisible = true;
this.panelEL.nativeElement.style.zIndex = ++DomHandler.zindex;
this.domHandler.fadeIn(this.panelEL.nativeElement, 200);
}
if(this.multiInputEL || this.inputEL) {
let hasFocus = this.multiple ? document.activeElement == this.multiInputEL.nativeElement : document.activeElement == this.inputEL.nativeElement ;
if(!this.panelVisible && hasFocus) {
this.panelVisible = true;
this.panelEL.nativeElement.style.zIndex = ++DomHandler.zindex;
this.domHandler.fadeIn(this.panelEL.nativeElement, 200);
}
}
}

align() {
Expand Down

0 comments on commit e76a79c

Please sign in to comment.