Skip to content

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

@fredmanxu

Description

@fredmanxu

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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions