From 983d4a10aed8774fd90df09960c68c8eb30057ae Mon Sep 17 00:00:00 2001 From: Alex-Monahan-Intel <101748193+Alex-Monahan-Intel@users.noreply.github.com> Date: Wed, 17 Aug 2022 12:23:44 -0700 Subject: [PATCH] Fix virtualScroll issue #2524 Scrolling to the bottom of a bootstrap-select with virtualScroll enabled (where the number of elements exceeded the configured value) would not show any li's. --- js/bootstrap-select.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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];