Skip to content
This repository has been archived by the owner on Feb 8, 2020. It is now read-only.

Commit

Permalink
fix: fix back button not working in header
Browse files Browse the repository at this point in the history
  • Loading branch information
satya164 committed Aug 18, 2019
1 parent 51b1069 commit 73424b8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
3 changes: 3 additions & 0 deletions packages/stack/src/views/Header/HeaderSegment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ export default class HeaderSegment extends React.Component<Props, State> {
<View pointerEvents="box-none" style={styles.content}>
{onGoBack ? (
<Animated.View
pointerEvents="box-none"
style={[styles.left, leftButtonStyle, leftContainerStyle]}
>
{left({
Expand All @@ -315,6 +316,7 @@ export default class HeaderSegment extends React.Component<Props, State> {
) : null}
{currentTitle ? (
<Animated.View
pointerEvents="box-none"
style={[
Platform.select({
ios: null,
Expand All @@ -336,6 +338,7 @@ export default class HeaderSegment extends React.Component<Props, State> {
) : null}
{right ? (
<Animated.View
pointerEvents="box-none"
style={[styles.right, rightButtonStyle, rightContainerStyle]}
>
{right({ tintColor: headerTintColor })}
Expand Down
6 changes: 1 addition & 5 deletions packages/stack/src/views/Stack/Stack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ export default class Stack extends React.Component<Props, State> {
focusedOptions.headerStyleInterpolator !== undefined
? focusedOptions.headerStyleInterpolator
: defaultTransitionPreset.headerStyleInterpolator,
style: [styles.header, styles.floating],
style: styles.floating,
})
: null}
</React.Fragment>
Expand All @@ -366,10 +366,6 @@ const styles = StyleSheet.create({
flex: 1,
overflow: 'hidden',
},
header: {
// This is needed to show elevation shadow
zIndex: Platform.OS === 'android' ? 1 : 0,
},
floating: {
position: 'absolute',
top: 0,
Expand Down
11 changes: 4 additions & 7 deletions packages/stack/src/views/TouchableItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,14 @@ export default class TouchableItem extends React.Component<Props> {
Platform.OS === 'android' &&
Platform.Version >= ANDROID_VERSION_LOLLIPOP
) {
const { style, ...rest } = this.props;
const { style, pressColor, borderless, children, ...rest } = this.props;

return (
<TouchableNativeFeedback
{...rest}
style={null}
background={TouchableNativeFeedback.Ripple(
this.props.pressColor,
this.props.borderless
)}
background={TouchableNativeFeedback.Ripple(pressColor, borderless)}
>
<View style={style}>{React.Children.only(this.props.children)}</View>
<View style={style}>{React.Children.only(children)}</View>
</TouchableNativeFeedback>
);
} else if (Platform.OS === 'ios') {
Expand Down

0 comments on commit 73424b8

Please sign in to comment.