From 34e8b695f0afd7f581cdf3034269653da6743902 Mon Sep 17 00:00:00 2001 From: "rodrigo.perez" Date: Tue, 14 Nov 2017 08:47:11 -0200 Subject: [PATCH] Fix up arrow error when there is no options --- src/js/select2/results.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/js/select2/results.js b/src/js/select2/results.js index f155821c..4ee3a84f 100644 --- a/src/js/select2/results.js +++ b/src/js/select2/results.js @@ -340,7 +340,8 @@ define([ var currentIndex = $options.index($highlighted); // If we are already at te top, don't move further - if (currentIndex === 0) { + // If no options, currentIndex will be -1 + if (currentIndex <= 0) { return; }