From 5737f03d202ce0f22d390b2e9f94b8573f59472b Mon Sep 17 00:00:00 2001 From: artur-pipchenko <132888787+artur-pipchenko@users.noreply.github.com> Date: Tue, 28 May 2024 09:01:02 +0200 Subject: [PATCH] fix(vue): avoid rendering same slide vnode twice for small amount of slides in loop + virtual mode (#7556) Co-authored-by: Artur --- src/vue/virtual.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vue/virtual.mjs b/src/vue/virtual.mjs index a09fadaab..d167e53c5 100644 --- a/src/vue/virtual.mjs +++ b/src/vue/virtual.mjs @@ -24,7 +24,7 @@ function renderVirtual(swiperRef, slides, virtualData) { const loopTo = swiperRef.value.params.loop ? slides.length * 2 : slides.length; const slidesToRender = []; for (let i = loopFrom; i < loopTo; i += 1) { - if (i >= from && i <= to) { + if (i >= from && i <= to && slidesToRender.length < slides.length) { slidesToRender.push(slides[getSlideIndex(i)]); } }