Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Commit 9d6cd8b

Browse files
committed
Add missing negative activeIndex check just like in select2.js.
1 parent 28466ab commit 9d6cd8b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/select.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -853,6 +853,10 @@
853853
throw uiSelectMinErr('choices', "Expected multiple .ui-select-choices-row but got '{0}'.", choices.length);
854854
}
855855

856+
if (ctrl.activeIndex < 0) {
857+
return;
858+
}
859+
856860
var highlighted = choices[ctrl.activeIndex];
857861
var posY = highlighted.offsetTop + highlighted.clientHeight - container[0].scrollTop;
858862
var height = container[0].offsetHeight;
@@ -1329,4 +1333,3 @@
13291333
};
13301334
});
13311335
}());
1332-

0 commit comments

Comments
 (0)