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.

carousel stop when i swiper to right, it can't loop

See original GitHub issue

screen shot 2018-07-04 at 11 57 17 am my code:

<Carousel
                    layout={'default'}
                    data={this.state.entries}
                    renderItem={this._renderItem.bind(this)}
                    sliderWidth={viewportWidth}
                    itemWidth={viewportWidth*0.575}
                    loop={true}
                    firstItem={2}
                    loopClonesPerSide={10}
                    //enableMomentum={true}
                    enableSnap={true}
                    inactiveSlideScale={0.95}
                    inactiveSlideOpacity={0.8}
                    onSnapToItem={(index) => this.setState({currentSwiperFilm:index}) }
/>

example when i swiper end of right, slider not loop 68747470733a2f2f692e696d6775722e636f6d2f574e4f4259666c2e676966

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
bd-arccommented, Jul 18, 2018

⚠️ You did not follow the contributing guidelines!

As stated in these:

You need to fill out the issue template. This step is mandatory! Not doing so will result in your issue getting closed. Don’t take this personally if this happens, and feel free to open a new issue once you’ve gathered all the information required by the template.


@nguyenvanphuc2203 Please provide a Snack example that reproduces the issue, otherwise we won’t be able to help you and the thread will be closed. You’ve already been asked to do so in #347.

@se1exin Your issue is not the same since it has to do with custom layouts and a pesky zIndex issue. But your guess is definitely right 😉 Please see #262 for more info and to find out some workarounds.

2reactions
se1exincommented, Jul 18, 2018

I had this exact problem on iOS yesterday and fixed it by stopping the render of hidden slides:

_renderItem ({item, index}) {
    // Fix for carousel stopping tap event after the second slide
    if (Platform.OS === 'android' || (this.state.slideIndex - 1) <= index) {
      return (<MyItem />)
}

My guess is that the ‘hidden’ slides are actually sitting on top of the carousel, thus preventing tap/slide events on the shown slide.

Note this does not fix the root issue, but is a (dirty) work around. I didn’t have time yesterday to write a full bug report… and now you have posted one for me 😃

Edit: My Carousel setup (using Stack layout)

<Carousel
            ref={(c) => {
              this._carousel = c;
            }}
            layout={'stack'}
            layoutCardOffset={10}
            data={this.state.data}
            firstItem={this.state.slideIndex}
            renderItem={this._renderItem}
            sliderWidth={Dimensions.get('window').width}
            itemWidth={Dimensions.get('window').width * 0.85}
            onSnapToItem={(slideIndex) => {
              LayoutAnimation.configureNext(LayoutAnimation.Presets.linear)
              this.setState({slideIndex})
            }}
          />
Read more comments on GitHub >

github_iconTop Results From Across the Web

carousel stop when i swiper to right, it can't loop · Issue #358
My guess is that the 'hidden' slides are actually sitting on top of the carousel, thus preventing tap/slide events on the shown slide....
Read more >
Swiper continous loop without pause between sliding
This works fine so far. But is it possible with the swiper not to stop between each 3 slides? Right now there is...
Read more >
AutoplayOptions | Swiper - v8.4.5
When enabled autoplay will be paused on mouse enter over Swiper container. If disableOnInteraction is also enabled, it will stop autoplay instead of...
Read more >
Bootstrap JS Carousel Reference
wrap, boolean, true, Specifies whether the carousel should go through all slides continuously, or stop at the last slide. true - cycle continuously;...
Read more >
How do I stop carousel from looping? - Shopify Community
owlCarousel ({ loop:false, margin: 5, nav: true, navText: ["<i ... It works fine on desktop, but you cannot swipe left/right on mobile.
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