wix / wix/react-native-ui-lib

[ANDROID] Carousel loop doesn't behave correctly

Open
#2,778 14 comments 0 reactions 1 assignee View on GitHub

@nitzanyiz is already working on this.

Since Oct 26, 2023.

bug
Dominant language
TypeScript
Stars
7.2k
Forks
748
Avg merge
2d 18h
Merged PRs (30d)
1

Description

Description

Auto play(loop) carousel on android jumps through indexes randomly and at most shows only 2-3 items, for example in an array of 18 items, it will only show indexes 0,1 and then jump to 17.

Expected behavior

Carousel should loop through all items as defined by items rendered

Actual behavior

Carousel jumps through items at random and at most shows only 2-3 items

Code snippet
<Carousel
    loop={true}
    autoplay={true}
    autoplayInterval={5000}
    showCounter={true}>
        {article?.multi_images?.map((item: string, index: number) => {
             return (
                 <Card.Image
                      key={index}
                      source={{uri: `${Config.ASSETS_URL}${item}`}}
                      cover={true} 
                      aspectRatio={1.34}
                      style={{
                          borderTopLeftRadius: 15,
                          borderTopRightRadius: 15,
                          borderBottomLeftRadius: article?.has_tickers ? 0 : 15,
                          borderBottomRightRadius: article?.has_tickers ? 0 : 15,
                      }}
                  />
              );
          })}
</Carousel>

Environment
  • React Native version: 0.72.6
  • React Native UI Lib version: 7.9.1
Affected platforms
  • Android
  • iOS
  • Web

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.