We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 60540d7 commit 5d68327Copy full SHA for 5d68327
templates/theme-default/assets/js/components/slider.js
@@ -183,10 +183,12 @@ function init(el) {
183
184
function getNextSlide(direction = 1) {
185
let next =
186
- direction > 0 ? activeSlide.nextElementSibling || activeSlide : activeSlide.previousElementSibling || activeSlide;
+ direction > 0
187
+ ? activeSlide?.nextElementSibling || activeSlide
188
+ : activeSlide?.previousElementSibling || activeSlide;
189
190
for (let i = 1; i < slidesPerGroup; i++) {
- next = direction > 0 ? next.nextElementSibling || next : next.previousElementSibling || next;
191
+ next = direction > 0 ? next?.nextElementSibling || next : next?.previousElementSibling || next;
192
}
193
194
return next;
0 commit comments