From 2bc0133170f1d7d1376d75afbc2fc3403b2c9a3a Mon Sep 17 00:00:00 2001 From: Junus Ergin Date: Mon, 10 Apr 2017 11:43:44 +0200 Subject: [PATCH] Update tag-input-autocomplete.component.ts The functions handleUpArrow() and handleDownArrow() did return a false in some cases for some reasons. If the selectedItemIndex is not null, nothing gets returned. This is against good code style, throws tslint error and crashes the AOT build. --- .../tag-input-autocomplete.component.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/components/tag-input-autocomplete/tag-input-autocomplete.component.ts b/lib/components/tag-input-autocomplete/tag-input-autocomplete.component.ts index 6ec185e..17d800a 100644 --- a/lib/components/tag-input-autocomplete/tag-input-autocomplete.component.ts +++ b/lib/components/tag-input-autocomplete/tag-input-autocomplete.component.ts @@ -143,18 +143,18 @@ export class TagInputAutocompleteComponent implements OnChanges, OnDestroy, OnIn handleUpArrow() { if (this.selectedItemIndex === null) { this.goToBottom(this.itemsCount); - return false; + } else { + this.goToPrevious(); } - this.goToPrevious(); } handleDownArrow() { // Initialize to zero if first time results are shown if (this.selectedItemIndex === null) { - this.goToTop(); - return false; + this.goToTop(); + } else { + this.goToNext(); } - this.goToNext(); } selectItem(itemIndex?: number): void {