Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

Reset current display index to first element in Pnp Carousel

$
0
0

I am using Pnp-SFX Carousel control in my react app.Here I am displaying Carousel like below:

<Carousel                            buttonsLocation={CarouselButtonsLocation.center}                            buttonsDisplay={CarouselButtonsDisplay.block}                            containerButtonsStyles={styles.carouselButtonsContainer}                            isInfinite={false}                            interval={null}                            startIndex={this.state.startIndex}                            prevButtonStyles={styles.preSlide}                            nextButtonStyles={styles.nextSlide}                            indicatorShape={CarouselIndicatorShape.circle}                            indicatorClassName={styles.customIndicator}                            element={this.state.allItems} // applying JSX element                            onMoveNextClicked={(index: number) => { }}                            onMovePrevClicked={(index: number) => { }}                                               />

I am setting the this.state.startIndex to '0'.I have dropdown also to filter to display to the specific element in the Carousel items on its change event. The event is triggering fine and filtering element in the Carousel by filtering in the this.state.allItems

But the Carousal is not displaying the element if we are not in the first element of the Carousel. But the filtered element is there in the 0th index element.

Kindly help on this.


Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>