Skip to content

Commit

Permalink
fix: make back button ripple visible (#11386)
Browse files Browse the repository at this point in the history
Please provide enough information so that others can review your pull
request.

**Motivation**

closes #9794

also observed that the ripple radius can be very slightly increased to
be like in the native android toolbar

why the `foreground` isn't simply `true`? see
facebook/react-native#37901

**Test plan**

tested locally
  • Loading branch information
vonovak committed Aug 1, 2023
1 parent dcb4e4c commit c43208f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/elements/src/Header/HeaderBackButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export function HeaderBackButton({
onPress={disabled ? undefined : handlePress}
pressColor={pressColor}
pressOpacity={pressOpacity}
android_ripple={{ borderless: true }}
android_ripple={androidRipple}
style={[styles.container, disabled && styles.disabled, style]}
hitSlop={Platform.select({
ios: undefined,
Expand All @@ -169,6 +169,12 @@ export function HeaderBackButton({
);
}

const androidRipple = {
borderless: true,
foreground: Platform.OS === 'android' && Platform.Version >= 23,
radius: 20,
};

const styles = StyleSheet.create({
container: {
alignItems: 'center',
Expand Down

0 comments on commit c43208f

Please sign in to comment.