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.

Autoplay doesn't work after scrolling one loop with vertical property

See original GitHub issue

Environment

React: 16.0.0-alpha.12
React native: 0.54.4
react-native-snap-carousel: 3.7.2

Target Platform:

Android (7.0)
iOS (10.3)

Steps to Reproduce

<Carousel
  loop={true}
  autoplay={true}
  vertical={true}
  sliderWidth={36}
  itemHeight={36}
  data={/*just two item*/}
  ...
/>

Actual Behavior

Autoplay doesn’t work after scrolling one loop

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
Xaber20110202commented, Apr 11, 2019

Same issue, I tried many props, cost almost 6 hours.

Then I found this:

Set sliderHeight, itemHeight to 41 (50, or larger), it works.

And if styles must need to be 36, you can set a wrapper View to wrap Carousel component, then set the wrapper View’s height to 36, and adjust the styles.

Like this

render = () => {
    const height = 46
    return <View style={{ height: 24 }}>
      <Carousel
        containerCustomStyle={{ position: 'relative', top: (46 - 24) / 2 }}
        ref={(c) => { this._carousel = c }}
        data={[ xxx, xxx, xxx ]}
        renderItem={this.renderItem}
        inactiveSlideScale={1}
        inactiveSlideOpacity={1}
        sliderHeight={height}
        itemHeight={height}
        inverted
        vertical
        loop
        useNativeDriver
        autoplay={true}
        autoplayDelay={3000}
        autoplayInterval={3000}
    />
    </View>
  }
0reactions
dohooocommented, Oct 8, 2021

Sorry, please allow me to advertise for my open source library! ~ I think this library react-native-reanimated-carousel will solve your problem. It is a high performance and very simple component, complete with React-Native reanimated 2

Read more comments on GitHub >

github_iconTop Results From Across the Web

Owl Carousel Won't Autoplay - Stack Overflow
I'm using the Owl Carousel on my site. According to their documentation, this piece of JavaScript should work ...
Read more >
AutoplayOptions | Swiper - v8.4.5
Interface AutoplayOptions. Object with autoplay parameters or boolean true to enable with default settings. example: const swiper = new Swiper('.swiper', ...
Read more >
Settings - lightGallery
Name Type Default addClass # string "" allowMediaOverlap # boolean false appendCounterTo # string ".lg‑toolbar"
Read more >
Config | reveal.js
bouncing the down arrow when they first encounter a vertical slide ... Alternatively, you can provide a function that returns the slide
Read more >
<model-viewer> Examples and Documentation
Akin to the CSS touch-action property (which does not work due to some iOS bugs), the default 'pan-y' allows touch users to vertically...
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