Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swipe over Image sometimes doesn't trigger the slide event #487

Closed
msqar opened this issue Mar 2, 2019 · 3 comments
Closed

Swipe over Image sometimes doesn't trigger the slide event #487

msqar opened this issue Mar 2, 2019 · 3 comments

Comments

@msqar
Copy link

msqar commented Mar 2, 2019

My render item is pretty basic and appears to be the same as the example.

    _renderItem({item, index}) {
        return (
            <View style={scopedStyles.imageContainer}>
                <Image style={scopedStyles.carouselImage} source={{uri: item.uri}}></Image>
            </View>
        );
    }

These are the styles:

    carouselContainer: {
        width: width,
        alignItems: 'center',
        justifyContent: 'center'
    },
    imageContainer: {
        marginTop: 20,
        borderRadius: 5,
        padding: 10,
        backgroundColor: CommonStyles.GRAY_200
    },
    carouselImage: {
        height: 250,
        resizeMode: 'contain'
    }

And I noticed that if I swipe over the Image, sometimes it will slide through the images, but for example if i make it to the last index, i can't go back by swiping over the image, the only way is by swiping over the View container (imageContainer View), outside of the image.

This is the carousel structure:

<Carousel
                                ref={(c) => { this._carousel = c; }}
                                data={this.props.data.pictures}
                                renderItem={this._renderItem}
                                sliderWidth={width}
                                itemWidth={width - 20}
                                layout={'tinder'}
                                loop={false}
                                onSnapToItem={(index) => this.setState({ carouselIndex: index }) }
                                // containerCustomStyle={{}}
                                // contentContainerCustomStyle={{}}
                            />
                            <Pagination
                                dotsLength={this.props.data.pictures.length}
                                activeDotIndex={this.state.carouselIndex}
                                containerStyle={styles.paginationContainer}
                                dotColor={'rgba(0, 0, 0, 0.92)'}
                                dotStyle={styles.paginationDot}
                                inactiveDotColor={'black'}
                                inactiveDotOpacity={0.4}
                                inactiveDotScale={0.6}
                                carouselRef={this._carousel}
                                tappableDots={!!this._carousel}
                                />

Why could this be happening? What am I missing? It's working kinda odd.

Thanks.

I'm using react-native 0.57.8 with snap-carousel ^3.7.5. Also, for now i'm testing on iOS Simulator.

@msqar msqar changed the title Swipe over Image doesn't trigger the slide Swipe over Image sometimes doesn't trigger the slide event Mar 2, 2019
@bd-arc
Copy link
Contributor

bd-arc commented Mar 4, 2019

⚠️ You did not follow the contributing guidelines!

As stated in these:

You need to fill out the issue template completely. This step is mandatory! Not doing so will result in your issue getting closed. Don't take this personally if this happens, and feel free to open a new issue once you've gathered all the information required by the template.


Unless you provide a Snack example in which the issue can be reproduced, as well as a complete description of everything you've tried, we won't be able to help you and the thread will be closed.

@mmgmail
Copy link

mmgmail commented Mar 14, 2019

I have the same issue
My slide has image in container and when i swiping, nothing happens like in odd slides, but swipe around image working.
It's happens only with 'tinder' or 'stack' layout

@bd-arc
Copy link
Contributor

bd-arc commented Apr 15, 2019

This is a duplicate of #262.

Feel free to continue the discussion there.

@bd-arc bd-arc closed this as completed Apr 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants