diff --git a/js/bootstrap-select.js b/js/bootstrap-select.js index 7055df413..185a77e6d 100644 --- a/js/bootstrap-select.js +++ b/js/bootstrap-select.js @@ -1347,7 +1347,9 @@ } } - if (currentChunk === undefined) currentChunk = 0; + //If the current chunk can't be found based on the scroll position + // in the loop above, we need to assume that we are in the final chunk, not the first chunk + if (currentChunk === undefined) currentChunk = chunkCount-1; prevPositions = [that.selectpicker.view.position0, that.selectpicker.view.position1];