Explorar o código

Fix up arrow error when there is no options

rodrigo.perez %!s(int64=7) %!d(string=hai) anos
pai
achega
34e8b695f0
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      src/js/select2/results.js

+ 2 - 1
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;
       }