Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export class TagInputAutocompleteComponent implements OnChanges, OnDestroy, OnIn
this.ensureHighlightVisible();
}

goToBottom(itemsCount) {
goToBottom(itemsCount: any) {
this.selectedItemIndex = itemsCount - 1;
this.ensureHighlightVisible();
}
Expand Down Expand Up @@ -146,6 +146,7 @@ export class TagInputAutocompleteComponent implements OnChanges, OnDestroy, OnIn
return false;
}
this.goToPrevious();
return false;
}

handleDownArrow() {
Expand All @@ -155,6 +156,7 @@ export class TagInputAutocompleteComponent implements OnChanges, OnDestroy, OnIn
return false;
}
this.goToNext();
return false;
}

selectItem(itemIndex?: number): void {
Expand All @@ -164,7 +166,7 @@ export class TagInputAutocompleteComponent implements OnChanges, OnDestroy, OnIn
}
}

ngOnChanges(changes) {
ngOnChanges(changes: any) {
if (this.selectFirstItem && this.itemsCount > 0) {
this.goToTop();
}
Expand Down
10 changes: 5 additions & 5 deletions lib/components/tag-input/tag-input.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export interface AutoCompleteItem {
]
})
export class TagInputComponent implements ControlValueAccessor, OnDestroy, OnInit {
@HostBinding('class.ng2-tag-input-focus') isFocused;
@HostBinding('class.ng2-tag-input-focus') isFocused: boolean;
@Input() addOnBlur: boolean = true;
@Input() addOnComma: boolean = true;
@Input() addOnEnter: boolean = true;
Expand Down Expand Up @@ -202,7 +202,7 @@ export class TagInputComponent implements ControlValueAccessor, OnDestroy, OnIni
}
}

onInputBlurred(event): void {
onInputBlurred(event: any): void {
if (this.addOnBlur) { this._addTags([this.inputValue]); }
this.isFocused = false;
}
Expand All @@ -212,15 +212,15 @@ export class TagInputComponent implements ControlValueAccessor, OnDestroy, OnIni
setTimeout(() => this.canShowAutoComplete = true);
}

onInputPaste(event): void {
onInputPaste(event: any): void {
let clipboardData = event.clipboardData || (event.originalEvent && event.originalEvent.clipboardData);
let pastedString = clipboardData.getData('text/plain');
let tags = this._splitString(pastedString);
this._addTags(tags);
setTimeout(() => this._resetInput());
}

onAutocompleteSelect(selectedItem) {
onAutocompleteSelect(selectedItem: any) {
this._addTags([selectedItem]);
this.tagInputElement.nativeElement.focus();
}
Expand Down Expand Up @@ -264,7 +264,7 @@ export class TagInputComponent implements ControlValueAccessor, OnDestroy, OnIni
addedTags.forEach(tag => this.addTag.emit(tag));
}

private _emitTagRemoved(removedTag): void {
private _emitTagRemoved(removedTag: any): void {
this.removeTag.emit(removedTag);
}

Expand Down