Skip to content

Carousel getting stuck on current index when scrolled vertically in Android #1039

@harshagrawal2412

Description

@harshagrawal2412

Is this a bug report, a feature request, or a question?

This is a bug report.

Have you followed the required steps before opening a bug report?

(Check the step you've followed - put an x character between the square brackets ([]).)

Have you made sure that it wasn't a React Native bug?

Yes, this behavior is specific to the react-native-snap-carousel implementation on Android. Scrolling outside the carousel area functions correctly, which indicates the issue is within the carousel's touch handling logic.

Is the bug specific to iOS or Android? Or can it be reproduced on both platforms?

The bug is specific to Android. It does not occur on iOS.

Is the bug reproductible in a production environment (not a debug one)?

Yes, the bug is reproducible in a production environment.

Environment

  • Platform: Android
  • Library Version: react-native-snap-carousel 3.9.1
  • React Native Version: 0.72.7

Expected Behavior

The carousel should allow vertical scrolling of the app even when the gesture starts on the carousel area, without freezing or locking the carousel at its current index.

Actual Behavior

When the user tries to scroll the app vertically by starting the gesture within the carousel's area, the carousel freezes at the current index and doesn't allow proper vertical scrolling.

Reproducible Demo

<Carousel
  ref={this.carouselRef}
  data={entries}
  renderItem={this.renderItem}
  sliderWidth={screenWidth}
  itemWidth={screenWidth * 0.8}
  autoplay={true}
  autoplayInterval={1000}
  loop={true}
/>

rn-carousel.mov

Steps to Reproduce

  1. Render a react-native-snap-carousel inside a vertically scrollable view.
  2. Attempt to scroll vertically starting the gesture from within the carousel area.
  3. Observe that the carousel locks at its current index, preventing vertical scrolling.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions