react-native-photo-view icon indicating copy to clipboard operation
react-native-photo-view copied to clipboard

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

Open fredmanxu opened this issue 2 years ago • 2 comments

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"

fredmanxu avatar May 18 '22 09:05 fredmanxu

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

fabiocomics avatar Dec 04 '22 21:12 fabiocomics

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

I didn't resolve it.

fredmanxu avatar Dec 05 '22 01:12 fredmanxu