question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

using autoplay with loop bug

See original GitHub issue

When using autoplay with loop the first slide is shown 2 times when reaching the last slide. I think when we loop to the last slide it then loops to first slide in a looped manner but then autoplay kicks in and it then again displays the first slide. Please look into it Regards Here is the implementation of carousel

    <Carousel
                    containerCustomStyle={
                        flexGrow: 0,
                        height: '50%',
                        paddingVertical: 0,
                    }
                    
                    layout={"default"}
                    data={carouselItems}
                    sliderWidth={width}
                    itemWidth={width}
                    autoplayInterval={4000}

                    autoplay
                    loop

                    inactiveSlideScale={1}
                    loopClonesPerSide={carouselItems.length-1}
                    renderItem={_renderItem}
                    onSnapToItem={index => setActiveIndex(index)}
              />

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:12

github_iconTop GitHub Comments

1reaction
muhamad-rizkicommented, Aug 27, 2020

ah my bad, sorry. I forgot that I changed the source code of carousel.js on line src/carousel/Carousel.js#L355, from return enableSnap && loop && data && data.length && data.length > 1; to return loop && data && data.length && data.length > 1;, now you can set enableSnap to false,

the problem is here src/carousel/Carousel.js#L906 this line make the animation weird 😄 or try comment this line and everything will works again

1reaction
basitmircommented, Aug 27, 2020

I have the same problem, I solved it by removing enableSnap props

the issue is resolved but not able to loop back to first item using touch gesture i.e by swiping

Read more comments on GitHub >

github_iconTop Results From Across the Web

using autoplay with loop bug · Issue #737
When using autoplay with loop the first slide is shown 2 times when reaching the last slide. I think when we loop to...
Read more >
Video loop autoplay won't work on Chrome/safari (webkit ...
Hi guys I am trying to have my video autoplay and loop in a slider but some how it's not playing on chrome...
Read more >
Video texture settings doesn't work (autoplay/loop...) - Bugs
Hello, it seems like I can't turn autoplay and loop to false in the settings of videoTexture's constructor.
Read more >
Fix HTML Video Autoplay Not Working
You've added a video tag to your website, set the video source, but it won't autoplay. Let's fix it.
Read more >
Solved: Is it possible to Autoplay New Storymap in a loop
@Ben_TC -- Sorry, it appears that is a bug that was introduced in one of our recent releases. Autoplay should loop to the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found