Skip to content

Commit

Permalink
fix(top-navigation): add hit-slop to actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Artur Yorsh authored and malashkevich committed Jun 12, 2019
1 parent f0234bf commit ce984cf
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ class TopNavigationActionComponent extends React.Component<TopNavigationActionPr
iconMarginHorizontal,
} = source;

const hitSlop: number = 40 - iconWidth;

return {
container: {
marginHorizontal: iconMarginHorizontal,
Expand All @@ -88,6 +90,12 @@ class TopNavigationActionComponent extends React.Component<TopNavigationActionPr
height: iconHeight,
...styles.icon,
},
hitSlop: {
top: hitSlop,
left: hitSlop,
bottom: hitSlop,
right: hitSlop,
},
};
};

Expand All @@ -103,6 +111,7 @@ class TopNavigationActionComponent extends React.Component<TopNavigationActionPr
return (
<TouchableOpacity
activeOpacity={1.0}
hitSlop={componentStyle.hitSlop}
{...touchableProps}
style={componentStyle.container}
onPress={this.onPress}
Expand Down

0 comments on commit ce984cf

Please sign in to comment.