Skip to content
New issue

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

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

Already on GitHub? # to your account

Bug report: Double tap on image in ios triggers onTap event. #212

Open
fredmanxu opened this issue May 18, 2022 · 2 comments
Open

Bug report: Double tap on image in ios triggers onTap event. #212

fredmanxu opened this issue May 18, 2022 · 2 comments

Comments

@fredmanxu
Copy link

Describe the bug

I do the action to close the view in the click event and it works fine in android but on ios when I try to double tap to enlarge the image the onTap event always fires causing my view to close.

Expected behavior

Double-clicking will not trigger the onTap event,like android.

Example code

      <PhotoView
                    source={{uri:"https://github.blog/wp-content/uploads/2022/04/InFocus-featured-image.png"}}
                    androidScaleType="fitCenter"
                    style={{width: 300, height: 300}}
                    onViewTap={(event) => {
                        if (Platform.OS === 'ios') {    //  Double-click on ios will trigger onViewTap events, but not on Android
                            console.log('onViewTap', 'ios')
                        } else {
                            this.props.navigation.goBack()
                        }
                    }}
                    onTap={(event) => {
                        if (Platform.OS === 'ios') {     //  Double-click on ios will trigger onTap events, but not on Android
                            console.log('onTap', 'ios')
                        } else {
                            this.props.navigation.goBack()
                        }
                    }}
                    onScale={() => {
                        console.log('onScale')
                    }}
                />

package.json

    "react": "17.0.2",
    "react-native": "^0.66.4",
    "react-native-photo-view": "^1.5.2"
@fabiocomics
Copy link

I'm having the same issue. Is there any news about this?
Thanks.

@fredmanxu
Copy link
Author

fredmanxu commented Dec 5, 2022

I'm having the same issue. Is there any news about this? Thanks.

I didn't resolve it.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants