Skip to content

Commit

Permalink
fix: onPress not work in some andriod phone like Huawei nova5 Plus+
Browse files Browse the repository at this point in the history
  • Loading branch information
huangteng02 committed Sep 2, 2020
1 parent 9365dbe commit 44a9ec4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions Lightbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const Lightbox = (props) => {
};

return (
<View ref={_root} style={props.style} onLayout={() => {}}>
<View ref={_root} style={props.style} onLayout={props.onLayout}>
<Animated.View style={{ opacity: layoutOpacity.current }}>
<TouchableOpacity
underlayColor={props.underlayColor}
Expand All @@ -119,6 +119,8 @@ Lightbox.propTypes = {
onOpen: PropTypes.func,
willClose: PropTypes.func,
onClose: PropTypes.func,
onLongPress: PropTypes.func,
onLayout: PropTypes.func,
springConfig: PropTypes.shape({
tension: PropTypes.number,
friction: PropTypes.number,
Expand All @@ -132,7 +134,8 @@ Lightbox.defaultProps = {
didOpen: () => {},
willClose: () => {},
onClose: () => {},
onLongPress: () => {},
onLongPress: null, // in andriod mobile, e.g HuaWei Nova5 Plus+, onPress will not work well
onLayout: () => {}
};

export default Lightbox;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-lightbox-v2",
"version": "0.8.3",
"version": "0.8.4",
"description": "Images etc in Full Screen Lightbox Popovers for React Native",
"main": "Lightbox.js",
"scripts": {
Expand Down

0 comments on commit 44a9ec4

Please sign in to comment.