meliorence / meliorence/react-native-snap-carousel

example1 is not working with onScroll

Open
#546 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

contribution?
Dominant language
JavaScript
Stars
10.5k
Forks
2.3k
PR merge metrics
No merged PRs in 30d

Description

This is a bug report.

	"react": "16.2.0",
	"react-native": "0.52.x",
	"react-native-linear-gradient": "2.4.0",
	"react-native-snap-carousel": "3.8.0"

I have been trying to run example1 code with onScroll like this.

            <Carousel
              ref={c => this._slider1Ref = c}
              data={ENTRIES1}
              renderItem={this._renderItemWithParallax}
              sliderWidth={sliderWidth}
              itemWidth={itemWidth}
              hasParallaxImages={true}
              firstItem={SLIDER_1_FIRST_ITEM}
              inactiveSlideScale={0.5}
              inactiveSlideOpacity={0.5}
              // inactiveSlideShift={20}
              containerCustomStyle={styles.slider}
              contentContainerCustomStyle={styles.sliderContentContainer}
              loop={true}
              loopClonesPerSide={2}
              autoplay={true}
              autoplayDelay={500}
              autoplayInterval={3000}
              onSnapToItem={(index) => this.setState({ slider1ActiveSlide: index }) }
              onScroll={e=>{//----------it's only code I have added.


              }}

            />

I have added empty onScroll prop then snap item seems to change as active or deactivate but not changing opacity and scale.
Please check it and help me how to fix it.

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.

Research direction

Start by running example1 with the listed React Native and react-native-snap-carousel versions, comparing the carousel with and without an empty onScroll prop. Trace the onScroll behavior and verify that adding the prop does not prevent inactive-slide opacity and scale changes from updating.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react-native
Domain
frontend, mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.