diff options
-rw-r--r-- | awesomplete.js | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/awesomplete.js b/awesomplete.js index 377ef7c..cd634b3 100644 --- a/awesomplete.js +++ b/awesomplete.js @@ -169,8 +169,7 @@ _.prototype = { next: function () { var count = this.ul.children.length; - var defaultPos = count ? 0 : -1; - this.goto(this.index < count - 1? this.index + 1 : defaultPos); + this.goto(this.index < count - 1 ? this.index + 1 : (count ? 0 : -1) ); }, previous: function () { |