Skip to content

Commit 44a9ec4

Browse files
author
huangteng02
committed
fix: onPress not work in some andriod phone like Huawei nova5 Plus+
1 parent 9365dbe commit 44a9ec4

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

Lightbox.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ const Lightbox = (props) => {
9494
};
9595

9696
return (
97-
<View ref={_root} style={props.style} onLayout={() => {}}>
97+
<View ref={_root} style={props.style} onLayout={props.onLayout}>
9898
<Animated.View style={{ opacity: layoutOpacity.current }}>
9999
<TouchableOpacity
100100
underlayColor={props.underlayColor}
@@ -119,6 +119,8 @@ Lightbox.propTypes = {
119119
onOpen: PropTypes.func,
120120
willClose: PropTypes.func,
121121
onClose: PropTypes.func,
122+
onLongPress: PropTypes.func,
123+
onLayout: PropTypes.func,
122124
springConfig: PropTypes.shape({
123125
tension: PropTypes.number,
124126
friction: PropTypes.number,
@@ -132,7 +134,8 @@ Lightbox.defaultProps = {
132134
didOpen: () => {},
133135
willClose: () => {},
134136
onClose: () => {},
135-
onLongPress: () => {},
137+
onLongPress: null, // in andriod mobile, e.g HuaWei Nova5 Plus+, onPress will not work well
138+
onLayout: () => {}
136139
};
137140

138141
export default Lightbox;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-lightbox-v2",
3-
"version": "0.8.3",
3+
"version": "0.8.4",
44
"description": "Images etc in Full Screen Lightbox Popovers for React Native",
55
"main": "Lightbox.js",
66
"scripts": {

0 commit comments

Comments
 (0)