From a4f6a1c629a531617752ca023987e40a97819bff Mon Sep 17 00:00:00 2001 From: Vadim Date: Sat, 11 Sep 2021 13:27:52 +0300 Subject: [PATCH] #69 : Support floating particlesToScroll, particlesToShow --- src/utils/clones.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/utils/clones.js b/src/utils/clones.js index c79e440..8f54f80 100644 --- a/src/utils/clones.js +++ b/src/utils/clones.js @@ -41,8 +41,9 @@ export function getClonesCount({ }) { const clonesCount = infinite ? { - head: partialPageSize || particlesToShow, - tail: particlesToShow, + // need to round with ceil as particlesToShow, particlesToShow can be floating (e.g. 1.5, 3.75) + head: Math.ceil(partialPageSize || particlesToShow), + tail: Math.ceil(particlesToShow), } : { head: 0, tail: 0,